projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3248518
)
gtk: check NULL before unref
author
huangqinjin
<huangqinjin@gmail.com>
Thu, 29 Jun 2017 03:35:34 +0000
(11:35 +0800)
committer
GitHub
<noreply@github.com>
Thu, 29 Jun 2017 03:35:34 +0000
(11:35 +0800)
modules/highgui/src/window_gtk.cpp
patch
|
blob
|
history
diff --git
a/modules/highgui/src/window_gtk.cpp
b/modules/highgui/src/window_gtk.cpp
index
e97ea2f
..
07b4c96
100644
(file)
--- a/
modules/highgui/src/window_gtk.cpp
+++ b/
modules/highgui/src/window_gtk.cpp
@@
-951,7
+951,8
@@
static gboolean cvImageWidget_draw(GtkWidget* widget, cairo_t *cr, gpointer data
}
cairo_paint(cr);
- g_object_unref(pixbuf);
+ if(pixbuf)
+ g_object_unref(pixbuf);
return TRUE;
}
@@
-1005,7
+1006,8
@@
static gboolean cvImageWidget_expose(GtkWidget* widget, GdkEventExpose* event, g
}
cairo_paint(cr);
- g_object_unref(pixbuf);
+ if(pixbuf)
+ g_object_unref(pixbuf);
cairo_destroy(cr);
return TRUE;
}