[gnome-flashback] screenshot: initialize data and prop variables
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] screenshot: initialize data and prop variables
- Date: Wed, 22 Jan 2020 18:08:24 +0000 (UTC)
commit 611051ced3e870b4096b5752b84b7857bccd7e24
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Jan 22 16:38:30 2020 +0200
screenshot: initialize data and prop variables
gnome-flashback/libscreenshot/gf-screenshot.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/gnome-flashback/libscreenshot/gf-screenshot.c b/gnome-flashback/libscreenshot/gf-screenshot.c
index 7da8e49..2b73aa6 100644
--- a/gnome-flashback/libscreenshot/gf-screenshot.c
+++ b/gnome-flashback/libscreenshot/gf-screenshot.c
@@ -557,6 +557,7 @@ get_gtk_frame_extents (GdkWindow *window,
xdisplay = gdk_x11_display_get_xdisplay (display);
xwindow = gdk_x11_window_get_xid (window);
gtk_frame_extents = XInternAtom (xdisplay, "_GTK_FRAME_EXTENTS", False);
+ data = NULL;
gdk_x11_display_error_trap_push (display);
result = XGetWindowProperty (xdisplay, xwindow, gtk_frame_extents,
@@ -694,6 +695,7 @@ get_active_window (void)
gdk_x11_display_error_trap_push (display);
+ prop = NULL;
status = XGetWindowProperty (xdisplay,
DefaultRootWindow (xdisplay),
_net_active_window,
@@ -707,21 +709,12 @@ get_active_window (void)
&bytes_after,
&prop);
+ gdk_x11_display_error_trap_pop_ignored (display);
+
if (status != Success ||
actual_type != XA_WINDOW)
{
- if (prop)
- XFree (prop);
-
- gdk_x11_display_error_trap_pop_ignored (display);
-
- return None;
- }
-
- if (gdk_x11_display_error_trap_pop (display) != Success)
- {
- if (prop)
- XFree (prop);
+ XFree (prop);
return None;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]