aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/wxe_driver.c
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-05-12 09:22:20 +0200
committerDan Gudmundsson <[email protected]>2015-05-12 09:22:20 +0200
commit62b24429f440c61ad930d919e49ec637d3580096 (patch)
treea5164b14f3b5608e19268b7a06b322685295ead4 /lib/wx/c_src/wxe_driver.c
parentccb1a2f06aa2b0ab77447572797d7fd75b2bd3c4 (diff)
downloadotp-62b24429f440c61ad930d919e49ec637d3580096.tar.gz
otp-62b24429f440c61ad930d919e49ec637d3580096.tar.bz2
otp-62b24429f440c61ad930d919e49ec637d3580096.zip
wx: Fix raise during emulator stoppage
When emulator is stopped all drivers are stopped but not unloaded and since the clean wx thread stoppage code was in unload callback it was not called and could cause crashes.
Diffstat (limited to 'lib/wx/c_src/wxe_driver.c')
-rw-r--r--lib/wx/c_src/wxe_driver.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/wx/c_src/wxe_driver.c b/lib/wx/c_src/wxe_driver.c
index ea52737fa2..ec1ba7f566 100644
--- a/lib/wx/c_src/wxe_driver.c
+++ b/lib/wx/c_src/wxe_driver.c
@@ -146,7 +146,12 @@ wxe_driver_stop(ErlDrvData handle)
if(sd->port_handle != WXE_DRV_PORT_HANDLE) {
// fprintf(stderr, "%s:%d: STOP \r\n", __FILE__,__LINE__);
meta_command(DELETE_PORT,sd);
- free(handle);
+ } else {
+ // fprintf(stderr, "%s:%d: STOP \r\n", __FILE__,__LINE__);
+ stop_native_gui(wxe_master);
+ unload_native_gui();
+ free(wxe_master);
+ wxe_master = NULL;
}
}
@@ -154,10 +159,6 @@ static void
wxe_driver_unload(void)
{
// fprintf(stderr, "%s:%d: UNLOAD \r\n", __FILE__,__LINE__);
- stop_native_gui(wxe_master);
- unload_native_gui();
- free(wxe_master);
- wxe_master = NULL;
}
static ErlDrvSSizeT