aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_perf_wx.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-04-28 15:36:37 +0200
committerDan Gudmundsson <[email protected]>2016-05-04 13:06:59 +0200
commit715915f811196fc33983f924bf3e91d5745692c1 (patch)
tree9e20cb673f1151f7b5c3592fae1cf2feb9a7692e /lib/observer/src/observer_perf_wx.erl
parent373fa0737e2cb4fc5593cfff5e7845859b931cc1 (diff)
downloadotp-715915f811196fc33983f924bf3e91d5745692c1.tar.gz
otp-715915f811196fc33983f924bf3e91d5745692c1.tar.bz2
otp-715915f811196fc33983f924bf3e91d5745692c1.zip
observer: Fix timing issue
Could crash if interval was updated before node was set.
Diffstat (limited to 'lib/observer/src/observer_perf_wx.erl')
-rw-r--r--lib/observer/src/observer_perf_wx.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/observer/src/observer_perf_wx.erl b/lib/observer/src/observer_perf_wx.erl
index b3d664d207..1010a6af4c 100644
--- a/lib/observer/src/observer_perf_wx.erl
+++ b/lib/observer/src/observer_perf_wx.erl
@@ -142,6 +142,8 @@ handle_event(#wx{id=?ID_REFRESH_INTERVAL, event=#wxCommand{type=command_menu_sel
#ti{fetch=F0} = Ti -> %% Same fetch interval force refresh
Wins = [W#win{max=undefined} || W <- Wins0],
{noreply, precalc(State#state{time=Ti, wins=Wins})};
+ Ti when Old =:= undefined ->
+ {noreply, State#state{time=Ti}};
Ti -> %% Changed fetch interval, drop all data
{noreply, restart_fetcher(node(Old), State#state{time=Ti})}
end;