bitdb needs to be closed before the automatic cleanup or else the codecvt of the path string (boost stuff) may have been deallocated causing aborts in MSVC