Hi all,

found the reason the MusicBrowserUI code crashes at random spots when you
open the
MusicBrowser, press the NewPlaylist button, then close the new window that
just got
opened.. :-}

at the end of MusicBrowserUI::CreateMainDialog(), when the message pump is
done and it's time for the window to go away.. the end of the function goes
(this code is in Dialog.cpp)

    m_hWnd = NULL;

the DestroyWindow() call causes the system to send WM_DESTROY to the
window's message queue, which calls the window's Destroy() member function,
which, if it has a parent, tells its parent to remove this window, and then
*deletes this object*.

so, we've deallocated our memory, then we return to that m_hWnd = NULL.. :-)
which corrupts our heap and likely overwrites & corrupts something in
thread that just grabbed that memory.


p.s. dialog_cpp.diff (attached) fixes this problem.



Reply via email to