Assert problem in SearchDynamicEventTable()

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ftrias
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Sep 10, 2017 2:46 pm

Assert problem in SearchDynamicEventTable()

Post by ftrias »

I am getting the following wxWidgets Debug Alert when I close my application. I'm not sure how to proceed figuring out what's the root cause. Any ideas would be greatly appreciated.

./src/common/event.cpp(1869): assert "nNew != dynamicEvents.size()" failed in SearchDynamicEventTable().

Call stack:
[01] wxEvtHandler::SearchDynamicEventTable(wxEvent&)
[02] wxEvtHandler::ProcessEventLocally(wxEvent&)
[03] wxEvtHandler::ProcessEvent(wxEvent&)
[04] wxWindowBase::SendDestroyEvent()
[05] wxFrameBase::~wxFrameBase()
[06] wxFrame::~wxFrame() frame.h:2
[07] MainFrameBaseClass::~MainFrameBaseClass() wxcrafter.cpp:59
[08] MainFrame::~MainFrame() MainFrame.cpp:4
[09] MainFrame::~MainFrame() MainFrame.cpp:4
[10] MainFrame::~MainFrame() MainFrame.cpp:3
[11] wxAppConsoleBase::ProcessIdle()
[12] wxAppBase::ProcessIdle()
[13] wxApp::ProcessIdle()
[14] wxEventLoopBase::ProcessIdle()
[15] wxCFEventLoop::OSXCommonModeObserverCallBack(__CFRunLoopObserver*, int, void*)
[16] __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
[17] __CFRunLoopDoObservers
[18] __CFRunLoopRun
[19] CFRunLoopRunSpecific
[20] RunCurrentEventLoopInMode
[21] ReceiveNextEventCommon

Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Assert problem in SearchDynamicEventTable()

Post by doublemax »

From the backtrace i see that you're under OSX, but which wxWidgets version are you using?

Regarding the assert: I've never seen that one before. As a first guess: Do you have any Bind() or Connect() calls without respective Unbind() / Disconnet() calls?
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Assert problem in SearchDynamicEventTable()

Post by ONEEYEMAN »

Hi,
In addition to doubklemax' reply:

1. Is "minimal" sample works for you?
2. Does "event" sample works for you?

Thank you.
ftrias
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Sep 10, 2017 2:46 pm

Re: Assert problem in SearchDynamicEventTable()

Post by ftrias »

I am using OSX 10.12 and wxWidgets 3.1.0 with CodeLite and wxCrafter. However, this app began on wxWidgets 3.0 so it may be a legacy problem.

The samples work fine. If I create a new project, it works. So it's clearly something wrong with my project, but I can't figure out what.

I checked all the Connect/Disconnect calls and they match up in the constructor of MainFrameBaseClass and its destructor.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Assert problem in SearchDynamicEventTable()

Post by doublemax »

Can you show the code? Otherwise this may be hard to track down.

If you can't, try commenting out all Connect and Disconnect calls. If the assert went away, put them back in one by one.
Use the source, Luke!
Post Reply