[ClutterTexture] Check before unrefing the fbo_handle
authorNeil Roberts <neil@linux.intel.com>
Thu, 30 Apr 2009 14:00:01 +0000 (15:00 +0100)
committerNeil Roberts <neil@linux.intel.com>
Thu, 30 Apr 2009 14:09:04 +0000 (15:09 +0100)
When replacing the fbo_handle with a new handle it first unrefs the
old handle. This was previously a call to cogl_offscreen_unref which
silently ignored attempts to unref COGL_INVALID_HANDLE. However the
new cogl_handle_unref does check for this so we should make sure the
handle is valid to avoid the warning.

clutter/clutter-texture.c

index 9eb1a31..e4a3801 100644 (file)
@@ -2303,7 +2303,8 @@ on_fbo_source_size_change (GObject          *object,
       CoglHandle tex;
 
       /* tear down the FBO */
-      cogl_handle_unref (priv->fbo_handle);
+      if (priv->fbo_handle != COGL_INVALID_HANDLE)
+        cogl_handle_unref (priv->fbo_handle);
 
       texture_free_gl_resources (texture);