aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/wxe_impl.cpp
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-05-31 09:15:05 +0200
committerDan Gudmundsson <[email protected]>2016-05-31 09:15:05 +0200
commitffd39bdee7d0cbac044ca6c72afb65689c33b168 (patch)
tree1426bffdff4216370a35e07ded62839de9568cfa /lib/wx/c_src/wxe_impl.cpp
parent492b0ac2e3305a37ab507b2ff2d9546456cf61e4 (diff)
parentb304be8094f283001d6dfbafab31ead37c585869 (diff)
downloadotp-ffd39bdee7d0cbac044ca6c72afb65689c33b168.tar.gz
otp-ffd39bdee7d0cbac044ca6c72afb65689c33b168.tar.bz2
otp-ffd39bdee7d0cbac044ca6c72afb65689c33b168.zip
Merge branch 'dgud/wx/fix-seqfault-in-cleanup'
* dgud/wx/fix-seqfault-in-cleanup: wx: Fix occasional seq fault after appliction stops
Diffstat (limited to 'lib/wx/c_src/wxe_impl.cpp')
-rw-r--r--lib/wx/c_src/wxe_impl.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp
index 175bcfce54..0d2da5d4a7 100644
--- a/lib/wx/c_src/wxe_impl.cpp
+++ b/lib/wx/c_src/wxe_impl.cpp
@@ -490,7 +490,7 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd)
if(it != ptr2ref.end()) {
wxeRefData *refd = it->second;
if(refd->alloc_in_erl) {
- if((refd->type == 4) && ((wxObject *)ptr)->IsKindOf(CLASSINFO(wxBufferedDC))) {
+ if((refd->type == 8) && ((wxObject *)ptr)->IsKindOf(CLASSINFO(wxBufferedDC))) {
((wxBufferedDC *)ptr)->m_dc = NULL; // Workaround
}
wxString msg;
@@ -500,7 +500,7 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd)
msg.Printf(wxT("Memory leak: {wx_ref, %d, %s}"),
refd->ref, cinfo->GetClassName());
send_msg("error", &msg);
- } else {
+ } else if(refd->type != 4) {
cleanup_ref = delete_object(ptr, refd);
}
if(cleanup_ref) {
@@ -562,7 +562,12 @@ int WxeApp::newPtr(void * ptr, int type, wxeMemEnv *memenv) {
if(wxe_debug) {
wxString msg;
- msg.Printf(wxT("Creating {wx_ref, %d, unknown} at %p "), ref, ptr);
+ const wxChar *class_info = wxT("unknown");
+ if(type < 10) {
+ wxClassInfo *cinfo = ((wxObject *)ptr)->GetClassInfo();
+ class_info = cinfo->GetClassName();
+ }
+ msg.Printf(wxT("Creating {wx_ref, %d, %s} at %p "), ref, class_info, ptr);
send_msg("debug", &msg);
}
@@ -614,12 +619,6 @@ void WxeApp::clearPtr(void * ptr) {
refd->memenv->ref2ptr[ref] = NULL;
free.Append(ref);
- if(wxe_debug) {
- wxString msg;
- msg.Printf(wxT("Deleting {wx_ref, %d, unknown} at %p "), ref, ptr);
- send_msg("debug", &msg);
- }
-
if(((int) refd->pid) != -1) {
// Send terminate pid to owner
wxeReturn rt = wxeReturn(WXE_DRV_PORT,refd->pid, false);