From c15c7c6b2117320aa5feb2c77781634d055cfcd7 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 26 Mar 2014 15:31:41 +0100 Subject: wx: Send destroy message direct Messages was routed via the wxe_server process, which caused process to never get the message. --- lib/wx/c_src/wxe_impl.cpp | 3 +-- lib/wx/src/wxe_server.erl | 13 +------------ 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'lib/wx') diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp index e3dc4862f2..f617aaf349 100644 --- a/lib/wx/c_src/wxe_impl.cpp +++ b/lib/wx/c_src/wxe_impl.cpp @@ -500,7 +500,6 @@ void WxeApp::destroyMemEnv(wxeMetaCommand& Ecmd) if(it != ptr2ref.end()) { wxeRefData *refd = it->second; if(refd->alloc_in_erl) { - int type = refd->type; if((refd->type == 1) && ((wxObject *)ptr)->IsKindOf(CLASSINFO(wxBufferedDC))) { ((wxBufferedDC *)ptr)->m_dc = NULL; // Workaround } @@ -622,7 +621,7 @@ void WxeApp::clearPtr(void * ptr) { if(((int) refd->pid) != -1) { // Send terminate pid to owner - wxeReturn rt = wxeReturn(WXE_DRV_PORT,refd->memenv->owner, false); + wxeReturn rt = wxeReturn(WXE_DRV_PORT,refd->pid, false); rt.addAtom("_wxe_destroy_"); rt.add(ERL_DRV_PID, refd->pid); rt.addTupleCount(2); diff --git a/lib/wx/src/wxe_server.erl b/lib/wx/src/wxe_server.erl index aed9dca7ce..465b9da2e0 100644 --- a/lib/wx/src/wxe_server.erl +++ b/lib/wx/src/wxe_server.erl @@ -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 @@ -192,17 +192,6 @@ handle_info({'DOWN',_,process,Pid,_}, State=#state{users=Users0,cleaners=Cs}) -> {noreply, State} end; -handle_info(Msg = {'_wxe_destroy_', Pid}, State) - when is_pid(Pid) -> - case erlang:is_process_alive(Pid) of - true -> - Pid ! Msg, - ok; - false -> - ok - end, - {noreply, State}; - handle_info(_Info, State) -> ?log("Unknown message ~p sent to ~p~n",[_Info, ?MODULE]), {noreply, State}. -- cgit v1.2.3