diff --git a/src/gd_v_call.erl b/src/gd_v_call.erl index a0bc9a4..7f3f084 100644 --- a/src/gd_v_call.erl +++ b/src/gd_v_call.erl @@ -276,7 +276,8 @@ handle_cast(Unexpected, State) -> handle_info(retire, State) -> - retire(State); + ok = retire(State), + {noreply, State}; handle_info(Unexpected, State) -> ok = log(warning, "Unexpected info: ~tp~n", [Unexpected]), {noreply, State}. @@ -295,7 +296,8 @@ handle_event(#wx{event = #wxCommand{type = command_button_clicked}, id = ID}, ok = copy(State), {noreply, State}; handle_event(#wx{event = #wxClose{}}, State) -> - retire(State); + ok = retire(State), + {noreply, State}; handle_event(Event, State) -> ok = tell(info, "Unexpected event ~tp State: ~tp~n", [Event, State]), {noreply, State}. @@ -305,11 +307,12 @@ code_change(_, State, _) -> {ok, State}. -retire(State = #s{frame = Frame}) -> - ok = wxWindow:destroy(Frame), - {stop, normal, State}. +retire(#s{frame = Frame}) -> + wxWindow:destroy(Frame). +terminate(wx_deleted, _) -> + wx:destroy(); terminate(Reason, State) -> ok = log(info, "Reason: ~tp, State: ~tp", [Reason, State]), wx:destroy(). diff --git a/src/gd_v_devman.erl b/src/gd_v_devman.erl index fc95568..b7a7405 100644 --- a/src/gd_v_devman.erl +++ b/src/gd_v_devman.erl @@ -298,6 +298,8 @@ code_change(_, State, _) -> {ok, State}. +terminate(wx_deleted, _) -> + wx:destroy(); terminate(Reason, State) -> ok = log(info, "Reason: ~tp, State: ~tp", [Reason, State]), wx:destroy().