Commit f98514d5 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Increase reference in zathura_page_widget_update_surface

and always destroy in render.
Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent c6140296
......@@ -505,11 +505,13 @@ zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
mutex_lock(&(priv->lock));
if (priv->surface != NULL) {
cairo_surface_finish(priv->surface);
cairo_surface_destroy(priv->surface);
}
priv->render_requested = false;
priv->surface = surface;
if (priv->surface != NULL) {
cairo_surface_reference(surface);
}
mutex_unlock(&(priv->lock));
/* force a redraw here */
if (priv->surface != NULL) {
......
......@@ -266,10 +266,10 @@ render(zathura_t* zathura, zathura_page_t* page)
GtkWidget* widget = zathura_page_get_widget(zathura, page);
zathura_page_widget_update_surface(ZATHURA_PAGE(widget), surface);
gdk_threads_leave();
} else {
cairo_surface_destroy(surface);
}
cairo_surface_destroy(surface);
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment