Mailing List Archive

r19405 - in projects/haf/trunk/clutter0.8: clutter/eglx debian
Author: kihamala
Date: 2009-10-01 14:18:49 +0300 (Thu, 01 Oct 2009)
New Revision: 19405

Modified:
projects/haf/trunk/clutter0.8/clutter/eglx/clutter-eglx-texture-pixmap.c
projects/haf/trunk/clutter0.8/debian/changelog
Log:
plug a memory leak



Modified: projects/haf/trunk/clutter0.8/clutter/eglx/clutter-eglx-texture-pixmap.c
===================================================================
--- projects/haf/trunk/clutter0.8/clutter/eglx/clutter-eglx-texture-pixmap.c 2009-10-01 08:52:59 UTC (rev 19404)
+++ projects/haf/trunk/clutter0.8/clutter/eglx/clutter-eglx-texture-pixmap.c 2009-10-01 11:18:49 UTC (rev 19405)
@@ -95,6 +95,8 @@

/* If the pixmap has changed, we'll want to try and recreate the surface */
gboolean pixmap_changed;
+
+ gboolean dispose_called;
};

void
@@ -180,6 +182,7 @@
priv->current_pixmap_depth = 0;
priv->current_pixmap_width = 0;
priv->current_pixmap_height = 0;
+ priv->dispose_called = FALSE;

if (_ext_check_done == FALSE)
{
@@ -211,10 +214,23 @@

priv = CLUTTER_EGLX_TEXTURE_PIXMAP (object)->priv;

+ /* this dispose handler is called twice because of how
+ * clutter_actor_destroy works */
+ if (priv->dispose_called)
+ return;
+
if (priv->egl_surface != EGL_NO_SURFACE)
clutter_eglx_texture_pixmap_surface_destroy(CLUTTER_ACTOR(object));

+ if (priv->texture_id)
+ {
+ glDeleteTextures (1, &priv->texture_id);
+ priv->texture_id = 0;
+ }
+
G_OBJECT_CLASS (clutter_eglx_texture_pixmap_parent_class)->dispose (object);
+
+ priv->dispose_called = TRUE;
}

static gboolean
@@ -362,6 +378,7 @@
g_debug ("%s: Unable to create cogl texture", __FUNCTION__);

glDeleteTextures (1, &priv->texture_id);
+ priv->texture_id = 0;

CLUTTER_NOTE (TEXTURE, "Falling back to X11 manual mechanism");
priv->use_fallback = TRUE;

Modified: projects/haf/trunk/clutter0.8/debian/changelog
===================================================================
--- projects/haf/trunk/clutter0.8/debian/changelog 2009-10-01 08:52:59 UTC (rev 19404)
+++ projects/haf/trunk/clutter0.8/debian/changelog 2009-10-01 11:18:49 UTC (rev 19405)
@@ -1,8 +1,12 @@
clutter (0.8.2-0maemo51~unreleased) unstable; urgency=low

- * foo
+ * clutter/eglx/clutter-eglx-texture-pixmap.c
+ (clutter_eglx_texture_pixmap_dispose): Delete the texture to avoid a
+ memory leak.
+ Fixes: NB#134230 - Memory leak in hildon-desktop when starting and closing
+ Media Player

- -- Kimmo Hämäläinen <kimmo.hamalainen@nokia.com> Tue, 29 Sep 2009 14:13:20 +0300
+ -- Kimmo Hämäläinen <kimmo.hamalainen@nokia.com> Thu, 01 Oct 2009 14:13:17 +0300

clutter (0.8.2-0maemo50) unstable; urgency=low


_______________________________________________
maemo-commits mailing list
maemo-commits@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-commits