summaryrefslogtreecommitdiffstats
path: root/src/openvg/qwindowsurface_vgegl.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-07-18 08:53:06 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-07-18 10:08:18 (GMT)
commit4e910f7d00dc3a08a2ac8578ecc8e0284b407bb9 (patch)
tree7d28e120ce3c700cfe5baa9522a007b1408f53b2 /src/openvg/qwindowsurface_vgegl.cpp
parentb05a513e1427dacc4c3de1b6d507616764248b96 (diff)
downloadQt-4e910f7d00dc3a08a2ac8578ecc8e0284b407bb9.zip
Qt-4e910f7d00dc3a08a2ac8578ecc8e0284b407bb9.tar.gz
Qt-4e910f7d00dc3a08a2ac8578ecc8e0284b407bb9.tar.bz2
Avoid crash when surface creation fails.
When the creation of the EGL window surface failed, the paint engine was not destroyed in the openvg module's window surface implementation. This led to accessing an obsolete engine instance later on in QSymbianControl::Draw, leading to a crash. Now a new, proper engine will be created, naturally the painting will still fail, but the application will not crash. Task-number: QTBUG-20339 Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/openvg/qwindowsurface_vgegl.cpp')
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index f7961b4..e16eeb3 100644
--- a/src/openvg/qwindowsurface_vgegl.cpp
+++ b/src/openvg/qwindowsurface_vgegl.cpp
@@ -686,6 +686,8 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget)
#endif
EGLSurface surface = context->createSurface(widget, &surfaceProps);
if (surface == EGL_NO_SURFACE) {
+ qt_vg_destroy_paint_engine(engine);
+ engine = 0;
qt_vg_destroy_context(context, QInternal::Widget);
context = 0;
return 0;