aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkjnilsson <[email protected]>2018-12-18 16:08:50 +0000
committerkjnilsson <[email protected]>2018-12-19 09:22:29 +0000
commit6d12c10932bdb5998c6bbb9328dd9e915f59ff85 (patch)
treefc63cb624c2add65fa2d0de0854bb12157f3f7dd
parentc6f59b2cd0973c5de44c382f70cfb876ff2db2e3 (diff)
downloadotp-6d12c10932bdb5998c6bbb9328dd9e915f59ff85.tar.gz
otp-6d12c10932bdb5998c6bbb9328dd9e915f59ff85.tar.bz2
otp-6d12c10932bdb5998c6bbb9328dd9e915f59ff85.zip
Observer: fix crash bug when expanding term
Observer makes use of cdv_html_wx but does not start cdv_wx first which made it crash when trying to send a message to cdv_wx. This fix avoids updating the status when the application using cdv_html_wx is cdv.
-rw-r--r--lib/observer/src/cdv_html_wx.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/observer/src/cdv_html_wx.erl b/lib/observer/src/cdv_html_wx.erl
index ffef83227c..8956173c93 100644
--- a/lib/observer/src/cdv_html_wx.erl
+++ b/lib/observer/src/cdv_html_wx.erl
@@ -79,14 +79,14 @@ handle_info(active, #state{panel=HtmlWin,delayed_fetch=Callback}=State)
observer_lib:sync_destroy_progress_dialog(),
wx_misc:beginBusyCursor(),
wxHtmlWindow:setPage(HtmlWin,HtmlText),
- cdv_wx:set_status(TW),
+ cdv_wx_set_status(State, TW),
wx_misc:endBusyCursor(),
{noreply, State#state{expand_table=Tab,
delayed_fetch=undefined,
trunc_warn=TW}};
handle_info(active, State) ->
- cdv_wx:set_status(State#state.trunc_warn),
+ cdv_wx_set_status(State, State#state.trunc_warn),
{noreply, State};
handle_info(Info, State) ->
@@ -164,3 +164,10 @@ expand(Id,Callback,#state{expand_wins=Opened0, app=App}=State) ->
Opened0
end,
State#state{expand_wins=Opened}.
+
+cdv_wx_set_status(#state{app = cdv}, Status) ->
+ %% this module is used by the observer when cdw_wx isn't started
+ %% only try to set status when used by cdv
+ cdv_wx:set_status(Status);
+cdv_wx_set_status(_, _) ->
+ ok.