aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_perf_wx.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/observer/src/observer_perf_wx.erl')
-rw-r--r--lib/observer/src/observer_perf_wx.erl5
1 files changed, 4 insertions, 1 deletions
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