From dd6cf1a26fdf371a2cd394bd282b6190458e961a Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Wed, 16 Sep 2009 11:11:41 +1000 Subject: Fix crash in QVGSharedContext shutdown The reference count was reducing down to zero during paint engine cleanup when we weren't ready to destroy the context. Artificially increase it to prevent the early context destroy. Reviewed-by: Sarah Smith --- src/openvg/qwindowsurface_vgegl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index 1365344..06759d4 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -139,6 +139,10 @@ QVGSharedContext::QVGSharedContext() QVGSharedContext::~QVGSharedContext() { + // Don't accidentally destroy the QEglContext if the reference + // count falls to zero while deleting the paint engine. + ++refCount; + if (context) qt_vg_make_current(context, qt_vg_shared_surface()); delete engine; -- cgit v0.12