Skip to content
Permalink
Browse files

screen: avoid 'NULL' in 'meta_error_trap...' functions

Fixes #445
  • Loading branch information...
sc0w authored and lukefromdc committed Jan 14, 2019
1 parent c0be5a7 commit a931b089754c0fc3e43705e9ac2137803274dced
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/core/screen.c
@@ -1221,21 +1221,23 @@ get_window_pixbuf (MetaWindow *window,
int *width,
int *height)
{
MetaDisplay *display;
cairo_surface_t *surface;
GdkPixbuf *pixbuf, *scaled;
double ratio;

display = window->display;
surface = meta_compositor_get_window_surface (window->display->compositor,
window);
if (surface == None)
return NULL;

meta_error_trap_push (NULL);
meta_error_trap_push (display);

pixbuf = meta_ui_get_pixbuf_from_surface (surface);
cairo_surface_destroy (surface);

if (meta_error_trap_pop_with_return (NULL, FALSE) != Success)
if (meta_error_trap_pop_with_return (display, FALSE) != Success)
g_clear_object (&pixbuf);

if (pixbuf == NULL)

0 comments on commit a931b08

Please sign in to comment.
You can’t perform that action at this time.