From: Andreas F. <an...@fa...> - 2013-10-08 15:33:12
|
On 07.10.2013 at 22:33 John Labenski wrote: >>> I'm trying to understand how wxLua handles its event mechanism. I can see that >>> for every call to Connect(), wxLua will create a new object of wxLuaEventCallback. >>> But I don't see where these get deleted. > > They are deleted by the wxEvtHandler when Connect() is called. > http://sourceforge.net/p/wxlua/svn/HEAD/tree/trunk/wxLua/modules/wxlua/wxlcallb.cpp#l93 > > Note the comment about the userdata here: > http://docs.wxwidgets.org/trunk/classwx_evt_handler.html#a78719e8b82c9f9c6e4056b3449df1943 > > Separately, wxluaR_unref() is used to unref the Lua event handler > functions that are called when a wxEvent is handled. You see two > calls to it, one for normal event handling and a separate one for > window destruction, this is to be expected. Thanks for the explanation. I didn't know that wxWidgets will delete the user data passed to Connect(). -- Best regards, Andreas Falkenhahn mailto:an...@fa... |