diff options
author | Dan Gudmundsson <[email protected]> | 2014-01-23 15:33:09 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2014-01-23 15:33:09 +0100 |
commit | fd055cf43486358a413a1fa22f30f0aa711d25e1 (patch) | |
tree | 2439dfc1481c3f3fb9225564e192bf234ccf829a /lib/wx/c_src/gen/wxe_funcs.cpp | |
parent | 84a83493c2bd9b01b3d90a2ebef49b0c698c0797 (diff) | |
download | otp-fd055cf43486358a413a1fa22f30f0aa711d25e1.tar.gz otp-fd055cf43486358a413a1fa22f30f0aa711d25e1.tar.bz2 otp-fd055cf43486358a413a1fa22f30f0aa711d25e1.zip |
wx: Delay all deletes if recursed in event loop
Avoids crashes.
Diffstat (limited to 'lib/wx/c_src/gen/wxe_funcs.cpp')
-rw-r--r-- | lib/wx/c_src/gen/wxe_funcs.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/wx/c_src/gen/wxe_funcs.cpp b/lib/wx/c_src/gen/wxe_funcs.cpp index 329af36f4d..82dd414911 100644 --- a/lib/wx/c_src/gen/wxe_funcs.cpp +++ b/lib/wx/c_src/gen/wxe_funcs.cpp @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2008-2013. All Rights Reserved. + * Copyright Ericsson AB 2008-2014. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -45,9 +45,14 @@ void WxeApp::wxe_dispatch(wxeCommand& Ecmd) switch (Ecmd.op) { case DESTROY_OBJECT: { - wxObject *This = (wxObject *) getPtr(bp,memenv); if(This) { ((WxeApp *) wxTheApp)->clearPtr((void *) This); - delete This; } - } break; + wxObject *This = (wxObject *) getPtr(bp,memenv); + if(This) { + if(recurse_level > 1) { + delayed_delete->Append(Ecmd.Save()); + } else { + ((WxeApp *) wxTheApp)->clearPtr((void *) This); + delete This; } + } } break; case WXE_REGISTER_OBJECT: { registerPid(bp, Ecmd.caller, memenv); rt.addAtom("ok"); |