gtk: check NULL before unref

pull/9031/head
huangqinjin 8 years ago committed by GitHub
parent 324851882a
commit aa75b6067c
  1. 2
      modules/highgui/src/window_gtk.cpp

@ -951,6 +951,7 @@ static gboolean cvImageWidget_draw(GtkWidget* widget, cairo_t *cr, gpointer data
}
cairo_paint(cr);
if(pixbuf)
g_object_unref(pixbuf);
return TRUE;
}
@ -1005,6 +1006,7 @@ static gboolean cvImageWidget_expose(GtkWidget* widget, GdkEventExpose* event, g
}
cairo_paint(cr);
if(pixbuf)
g_object_unref(pixbuf);
cairo_destroy(cr);
return TRUE;

Loading…
Cancel
Save