From be1140bf0040963b50a5b80be123245c98833b96 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 31 Aug 2009 09:56:12 +1000 Subject: Destroy EGL window surface when direct VG surface is deleted OpenVG window surfaces were leaking because the QVGEGLWindowSurfaceDirect destructor was previously not cleaning up the EGLSurface object. Reviewed-by: trustme --- src/openvg/qwindowsurface_vgegl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index ae91bb2..ba711b7 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -618,6 +618,12 @@ QVGEGLWindowSurfaceDirect::QVGEGLWindowSurfaceDirect(QWindowSurface *win) QVGEGLWindowSurfaceDirect::~QVGEGLWindowSurfaceDirect() { + destroyPaintEngine(); + if (context) { + if (windowSurface != EGL_NO_SURFACE) + qt_vg_destroy_surface(context, windowSurface); + qt_vg_destroy_context(context); + } } QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) -- cgit v0.12