diff options
author | Dan Gudmundsson <[email protected]> | 2014-03-24 14:59:35 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2014-03-25 10:54:29 +0100 |
commit | c990322544269e7fc333506c71c8a39aec08c403 (patch) | |
tree | af21a49784b9bf6afb116747aec1105f94dcbc5d /lib/wx/c_src/wxe_impl.cpp | |
parent | f8a509d025fd920525ed49687465d422d71bc165 (diff) | |
download | otp-c990322544269e7fc333506c71c8a39aec08c403.tar.gz otp-c990322544269e7fc333506c71c8a39aec08c403.tar.bz2 otp-c990322544269e7fc333506c71c8a39aec08c403.zip |
wx: Fix memory garbage collector
Diffstat (limited to 'lib/wx/c_src/wxe_impl.cpp')
-rw-r--r-- | lib/wx/c_src/wxe_impl.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp index 7d5050e2d0..eeccca1de7 100644 --- a/lib/wx/c_src/wxe_impl.cpp +++ b/lib/wx/c_src/wxe_impl.cpp @@ -418,6 +418,13 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd) wxWindow *parent = NULL; wxeMemEnv * memenv = refmap[Ecmd.port]; + if(!memenv) { + wxString msg; + msg.Printf(wxT("MemEnv already deleted")); + send_msg("debug", &msg); + return; + } + if(wxe_debug) { wxString msg; msg.Printf(wxT("Destroying all memory ")); @@ -446,7 +453,6 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd) } if(recurse_level > 0) { // Delay delete until we are out of dispatch* - delayed_cleanup->Append(Ecmd.Clone()); } else { delete win; } @@ -455,9 +461,10 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd) } } - if(recurse_level > 0) + if(recurse_level > 0) { + delayed_cleanup->Append(Ecmd.Clone()); return; - + } // First pass, delete all top parents/windows of all linked objects // fprintf(stderr, "close port %x\r\n", Ecmd.port);fflush(stderr); |