Stop library before checking for mem leaks