aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2013-10-30 16:46:54 +0100
committerDan Gudmundsson <[email protected]>2013-10-30 16:46:54 +0100
commitc054ac3d4df7fe8b2f58204e677f275bd8f0e60c (patch)
tree178e2dd83ca426d08d767be91a664b2bf6153e25 /lib/wx/api_gen
parent1d7472911e14e4885c9111aa21fc201c397be20f (diff)
downloadotp-c054ac3d4df7fe8b2f58204e677f275bd8f0e60c.tar.gz
otp-c054ac3d4df7fe8b2f58204e677f275bd8f0e60c.tar.bz2
otp-c054ac3d4df7fe8b2f58204e677f275bd8f0e60c.zip
wx: Fix cleanup of event handlers
Event handlers was not removed after objects/process had been delete/died, which causes memory leakage and that fun's was kept in the wx_server process. Code that might be purged and the server died.
Diffstat (limited to 'lib/wx/api_gen')
-rw-r--r--lib/wx/api_gen/wx_extra/wxEvtHandler.c_src14
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl2
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src b/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src
index 4e492db045..9c5f46b253 100644
--- a/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src
+++ b/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src
@@ -29,13 +29,13 @@ case 100: { // wxEvtHandler::Connect
int eventType = wxeEventTypeFromAtom(bp); bp += *eventTypeLen;
char *class_name = bp; bp+= *class_nameLen;
if(eventType > 0 ) {
- wxeCallbackData * Evt_cb = new wxeCallbackData(Ecmd.caller,(void *) This,
- class_name,*fun_cb,
- *skip, userData);
- This->Connect((int) *winid,(int) *lastId,eventType,
- (wxObjectEventFunction)(wxEventFunction) &wxeEvtListener::forward,
- Evt_cb, Listener);
- rt.addAtom("ok");
+ wxeCallbackData * Evt_cb = new wxeCallbackData(Ecmd.caller,getRef(This, memenv),
+ class_name,*fun_cb,
+ *skip, userData, Listener);
+ This->Connect((int) *winid,(int) *lastId,eventType,
+ (wxObjectEventFunction)(wxEventFunction) &wxeEvtListener::forward,
+ Evt_cb, Listener);
+ rt.addAtom("ok");
} else {
rt.addAtom("badarg");
rt.addAtom("event_type");
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index f00fc0c720..7e35ebfa83 100644
--- a/lib/wx/api_gen/wx_gen_cpp.erl
+++ b/lib/wx/api_gen/wx_gen_cpp.erl
@@ -1223,7 +1223,7 @@ encode_events(Evs) ->
w("~n rt.addAtom((char*)\"wx\");~n"
" rt.addInt((int) event->GetId());~n"
- " rt.addRef(getRef((void *)(cb->obj), memenv), cb->class_name);~n"
+ " rt.addRef(cb->obj, cb->class_name);~n"
" rt.addExt2Term(cb->user_data);~n"),
w(" switch(Etype->cID) {~n"),