Page 1 of 1

assert GetEventHandler()== this failed

Posted: Tue Nov 01, 2011 8:10 am
by samsam598
When I build wxFreeChart(http://sourceforge.net/projects/wxcode/ ... omponents/) with wx2.9.2 and/or wx2.9.3 +MinGW3.4.5 under windows xp,everything goes fine,the lib's generated and the sample program runs.But when I click X to close the sample window,wxWidgets Debug Alert window popped out and said:

Code: Select all

../../src/common/wincmn.cpp(468):assert "assert GetEventHandler()== this" failed in ~wxWindowBase():any pushed event handlers must have been removed.
Do you want to stop the program?
...
I have no clue what happened here and where to find the problem.
Could anybody help to figure me out where to start to search the possible problem?

Thanks for your help in advance.

Best Regards,
Sam

Re: assert GetEventHandler()== this failed

Posted: Thu Dec 15, 2011 12:23 pm
by PB
I know it's somewhat late to respond to this (I started using wxFreeChart just yesterday and run into the same problem), but better late than never right?

Making an wxAuiManager instance a MainFrame member variable and calling its UnInit() method in the MainFrame destructor in the sample got me rid of the problems (wxWidgets 2.9.3, MSVC 2008, static monolithic build).So fortunately it was an issue just with the demo application and not the library itself.

Hope it helps (someone).

Re: assert GetEventHandler()== this failed

Posted: Fri Dec 16, 2011 3:15 am
by samsam598
PB wrote:I know it's somewhat late to respond to this (I started using wxFreeChart just yesterday and run into the same problem), but better late than never right?

Making an wxAuiManager instance a MainFrame member variable and calling its UnInit() method in the MainFrame destructor in the sample got me rid of the problems (wxWidgets 2.9.3, MSVC 2008, static monolithic build).So fortunately it was an issue just with the demo application and not the library itself.

Hope it helps (someone).
Thank you so much,PB!!It isn't late.The issue's fixed and the thread should be marked now. :D

Re: assert GetEventHandler()== this failed

Posted: Tue Nov 26, 2013 3:32 pm
by f4grx
Hello,

I also got this problem with the recently released wxWidgets 3.0 in Windows Seven / mingw32TDM.

The proposed solution (calling wxAuiManager->UnInit(); in the frame destructor) also solved the problem.

Thank you!

Re: assert GetEventHandler()== this failed

Posted: Tue Nov 26, 2013 7:36 pm
by PB
As this is rather common problem with (the first-time use of) AUI, I am surprised patch from this ticket, seemingly simple, working and backwards compatible was not been applied long time ago. Perhaps it somewhat slipped through the cracks...

Re: assert GetEventHandler()== this failed

Posted: Sat Jul 14, 2018 3:03 pm
by ollydbg23
PB wrote:As this is rather common problem with (the first-time use of) AUI, I am surprised patch from this ticket, seemingly simple, working and backwards compatible was not been applied long time ago. Perhaps it somewhat slipped through the cracks...
I meet this issue today(I just forget to add the Uninit() function call), and I see this ticket is still not resolved. That's 6 years. :(