diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-16 01:11:41 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-16 01:11:41 (GMT) |
commit | dd6cf1a26fdf371a2cd394bd282b6190458e961a (patch) | |
tree | eea94c2cbf3dd74bce90fbc7621e5f77587aab75 /src/openvg | |
parent | dcd4b15595a63864ee59a19d80f1ba33b4821aa3 (diff) | |
download | Qt-dd6cf1a26fdf371a2cd394bd282b6190458e961a.zip Qt-dd6cf1a26fdf371a2cd394bd282b6190458e961a.tar.gz Qt-dd6cf1a26fdf371a2cd394bd282b6190458e961a.tar.bz2 |
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
Diffstat (limited to 'src/openvg')
-rw-r--r-- | src/openvg/qwindowsurface_vgegl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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; |