mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 12:36:00 +01:00
Increase reference in zathura_page_widget_update_surface
and always destroy in render. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
c6140296cd
commit
f98514d5ed
2 changed files with 5 additions and 3 deletions
|
@ -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) {
|
||||
|
|
4
render.c
4
render.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue