[mutter] cursor: Don't free the image if it hasn't loaded



commit 593b417e5e3e49ecd2cf24421afd30ee8a79a8c9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Dec 4 09:45:38 2014 -0800

    cursor: Don't free the image if it hasn't loaded
    
    Otherwise, we'll try to free a null image and crash.

 src/backends/meta-cursor.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/backends/meta-cursor.c b/src/backends/meta-cursor.c
index e70b328..edab7d9 100644
--- a/src/backends/meta-cursor.c
+++ b/src/backends/meta-cursor.c
@@ -55,7 +55,8 @@ meta_cursor_reference_ref (MetaCursorReference *self)
 static void
 meta_cursor_image_free (MetaCursorImage *image)
 {
-  cogl_object_unref (image->texture);
+  if (image->texture)
+    cogl_object_unref (image->texture);
 
 #ifdef HAVE_NATIVE_BACKEND
   if (image->bo)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]