aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-04-28 15:04:43 +0200
committerDan Gudmundsson <[email protected]>2016-05-04 13:06:59 +0200
commit373fa0737e2cb4fc5593cfff5e7845859b931cc1 (patch)
tree2f1cac070dadd91f25abbd46d490ec951f1dac8c
parentde3be15406c50ba43df3d162283112711b6aa53a (diff)
downloadotp-373fa0737e2cb4fc5593cfff5e7845859b931cc1.tar.gz
otp-373fa0737e2cb4fc5593cfff5e7845859b931cc1.tar.bz2
otp-373fa0737e2cb4fc5593cfff5e7845859b931cc1.zip
Observer: do not create PaintDC outside of paint callbacks
Bug introduced in bde2d01506a63, does work on linux but not on the other OS's.
-rw-r--r--lib/observer/src/observer_app_wx.erl4
-rw-r--r--lib/observer/src/observer_perf_wx.erl5
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/observer/src/observer_app_wx.erl b/lib/observer/src/observer_app_wx.erl
index 0e01429aa7..cef83037d0 100644
--- a/lib/observer/src/observer_app_wx.erl
+++ b/lib/observer/src/observer_app_wx.erl
@@ -302,7 +302,9 @@ handle_info({delivery, _Pid, app, _Curr, {[], [], [], []}},
handle_info({delivery, Pid, app, Curr, AppData},
State = #state{panel=Panel, appmon=Pid, current=Curr, usegc=UseGC,
app_w=AppWin, paint=#paint{font=Font}}) ->
- GC = make_gc(AppWin, UseGC),
+ GC = if UseGC -> {?wxGC:create(AppWin), false};
+ true -> {false, wxWindowDC:new(AppWin)}
+ end,
setFont(GC, Font, {0,0,0}),
App = build_tree(AppData, GC),
destroy_gc(GC),
diff --git a/lib/observer/src/observer_perf_wx.erl b/lib/observer/src/observer_perf_wx.erl
index 45af08026a..b3d664d207 100644
--- a/lib/observer/src/observer_perf_wx.erl
+++ b/lib/observer/src/observer_perf_wx.erl
@@ -762,7 +762,10 @@ make_gc(Panel,UseGC) ->
destroy_gc({GC, DC}) ->
(GC =/= false) andalso ?wxGC:destroy(GC),
- wxPaintDC:destroy(DC).
+ case DC =/= false andalso wx:getObjectType(DC) of
+ false -> ok;
+ Type -> Type:destroy(DC)
+ end.
haveGC() ->
try