From 373fa0737e2cb4fc5593cfff5e7845859b931cc1 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 28 Apr 2016 15:04:43 +0200 Subject: Observer: do not create PaintDC outside of paint callbacks Bug introduced in bde2d01506a63, does work on linux but not on the other OS's. --- lib/observer/src/observer_perf_wx.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/observer/src/observer_perf_wx.erl') 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 -- cgit v1.2.3