Search
SailfishOS Open Build Service
>
Projects
>
home:ced117
:
sailfish
>
xulrunner-qt5
> _service:tar_git:0009-Make-TextureImageEGL-hold-a-reference-to-GLContext.-.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:0009-Make-TextureImageEGL-hold-a-reference-to-GLContext.-.patch of Package xulrunner-qt5
From 3b925765c521eea1b2bb8211db1d7933e7f83c78 Mon Sep 17 00:00:00 2001 From: Piotr Tworek <piotr.tworek@jollamobile.com> Date: Wed, 8 Jul 2015 16:13:11 +0200 Subject: [PATCH 09/15] Make TextureImageEGL hold a reference to GLContext. Fixes JB#30109. Due to rather non standard view shutdown procedure of EmbedLite port objets like TextureImageEGL often end up being destroyed after the CompositorOGL. The problem arises if all objects keeping references to GLContext get destroyed before TextureImageEGL. In such case the TextureImageEGL::mGLContext pointer will contain a referene to already freed memrory. What is worse since the GLContext is used to access platform GL implementation we won't be able to remove GL textures allocated for the TextureImageEGL leading to GPU memory leak. This patch converts the TextureImageEGL::mGLContext pointer into nsRefPtr. This should ensure that the object will actually increase GLTexture reference count and keep it alive for as long as needed. With the patch in place the GPU memory leak is no longer observable and we should no longer end up accessing freed memory. Signed-off-by: Raine Makelainen <raine.makelainen@jolla.com> --- gfx/gl/TextureImageEGL.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/gl/TextureImageEGL.h b/gfx/gl/TextureImageEGL.h index 747d593..4feab85 100644 --- a/gfx/gl/TextureImageEGL.h +++ b/gfx/gl/TextureImageEGL.h @@ -63,7 +63,7 @@ public: protected: typedef gfxImageFormat ImageFormat; - GLContext* mGLContext; + nsRefPtr<GLContext> mGLContext; nsIntRect mUpdateRect; gfx::SurfaceFormat mUpdateFormat; -- 2.1.4