foo_keep_queue
Reply #25 – 2010-11-11 03:56:47
Carpman's crash happens in the destructor of "[font= "Courier New"]static pfc::list_t<t_playback_queue_item> queue_backup[/font]", because the [font= "Courier New"]t_playback_queue_item.m_handle[/font] is invalid, but not [font= "Courier New"]NULL[/font] - probably points to an already released memory. That certainly should not happen, [font= "Courier New"]metadb_handle[/font]s are reference counted for a reason. I can only guess, maybe some other component releases a handle too many times? Might be also that one of the callbacks forwarded to [font= "Courier New"]backup_queue()[/font] gets called after cleaning the [font= "Courier New"]queue_backup[/font] in [font= "Courier New"]on_quit()[/font], therefore filling it again, possibly leaving a stray pointer around again. I don't know and it's hard to guess. So anyway, it might be a good idea to not hold any references to metadb_handles, services or other shared objects till DLL unload, so I'd suggest having maybe a global flag like "[font= "Courier New"]bool g_shutting_down[/font]", which would ensure nothing would be done after [font= "Courier New"]on_quit()[/font] and see if that helped. And perhaps explicitely destroying the [font= "Courier New"]queue_pos[/font] array too, in case there is anything left there. Additionally, better don't include the 3 MB Debug\foo_keep_queue.ilk and testing fb2k install in your source code package, it's unnecessarily large then. If anything, including a .pdb file for the release would be more useful.