From: Carlos Garcia Campos Date: Wed, 9 Dec 2009 17:14:06 +0000 (+0100) Subject: [libview] Unref EvPage as soon as page is rendered X-Git-Tag: EVINCE_2_29_4~24 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=e3c697ada15e7e5ffd47562350bdfee455b29322;p=evince.git [libview] Unref EvPage as soon as page is rendered --- diff --git a/libview/ev-jobs.c b/libview/ev-jobs.c index d13c06b2..df15f6db 100644 --- a/libview/ev-jobs.c +++ b/libview/ev-jobs.c @@ -448,12 +448,8 @@ ev_job_render_dispose (GObject *object) job = EV_JOB_RENDER (object); - if (job->ev_page) { - ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job->ev_page->index, job); - g_object_unref (job->ev_page); - job->ev_page = NULL; - } - + ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job->page, job); + if (job->surface) { cairo_surface_destroy (job->surface); job->surface = NULL; @@ -476,6 +472,7 @@ static gboolean ev_job_render_run (EvJob *job) { EvJobRender *job_render = EV_JOB_RENDER (job); + EvPage *ev_page; EvRenderContext *rc; ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job_render->page, job); @@ -487,9 +484,10 @@ ev_job_render_run (EvJob *job) ev_document_fc_mutex_lock (); - job_render->ev_page = ev_document_get_page (job->document, job_render->page); - rc = ev_render_context_new (job_render->ev_page, job_render->rotation, job_render->scale); - + ev_page = ev_document_get_page (job->document, job_render->page); + rc = ev_render_context_new (ev_page, job_render->rotation, job_render->scale); + g_object_unref (ev_page); + job_render->surface = ev_document_render (job->document, rc); /* If job was cancelled during the page rendering, * we return now, so that the thread is finished ASAP diff --git a/libview/ev-jobs.h b/libview/ev-jobs.h index 8777d4c4..7be4d4a3 100644 --- a/libview/ev-jobs.h +++ b/libview/ev-jobs.h @@ -205,7 +205,6 @@ struct _EvJobRender gint rotation; gdouble scale; - EvPage *ev_page; gboolean page_ready; gint target_width; gint target_height;