]> www.fi.muni.cz Git - evince.git/commitdiff
Some leaks fixed
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sun, 19 Jun 2005 20:58:21 +0000 (20:58 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sun, 19 Jun 2005 20:58:21 +0000 (20:58 +0000)
* pdf/ev-poppler.cc:
* shell/ev-sidebar-links.c: (job_finished_callback):
* shell/ev-view.c: (update_find_status_message):

Some leaks fixed

ChangeLog
pdf/ev-poppler.cc
shell/ev-sidebar-links.c
shell/ev-view.c

index 1e9d6d531796aff8f23b5d23bfa8c957eabb1da8..4548cf82c6d1471784c3c84a65591e1719da81d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-06-20  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * pdf/ev-poppler.cc:
+       * shell/ev-sidebar-links.c: (job_finished_callback):
+       * shell/ev-view.c: (update_find_status_message):
+       
+       Some leaks fixed
+
 2005-06-19  Christian Persch  <chpe@cvs.gnome.org>
 
        * cut-n-paste/recent-files/egg-recent-view-uimanager.c:
index cfb745d0b51cfdd3d5df4e2eb5fbaea70cf26f1c..8916ae1860eb2370ef1dbd88364cb3375fdb9aef 100644 (file)
@@ -189,6 +189,7 @@ get_document_orientation (PdfDocument *pdf_document)
        } else {
                return POPPLER_ORIENTATION_PORTRAIT;
        }
+       g_object_unref (page);
 #else
        return POPPLER_ORIENTATION_PORTRAIT;
 #endif
@@ -240,6 +241,7 @@ pdf_document_get_page_size (EvDocument   *document,
        poppler_page = poppler_document_get_page (pdf_document->document, page);
        set_page_orientation (pdf_document, poppler_page);
        poppler_page_get_size (poppler_page, width, height);
+       g_object_unref (poppler_page);
 }
 
 static char *
@@ -255,6 +257,7 @@ pdf_document_get_page_label (EvDocument *document,
        g_object_get (G_OBJECT (poppler_page),
                      "label", &label,
                      NULL);
+       g_object_unref (poppler_page);
 
        return label;
 }
@@ -293,6 +296,7 @@ pdf_document_get_links (EvDocument *document,
        }
 
        poppler_page_free_link_mapping (mapping_list);
+       g_object_unref (poppler_page);
 
        return g_list_reverse (retval);
 }
@@ -328,7 +332,9 @@ pdf_document_render_pixbuf (EvDocument   *document,
                                       scale,
                                       pixbuf,
                                       0, 0);
-
+       
+       g_object_unref (poppler_page);
+       
        return pixbuf;
 }
 
@@ -503,6 +509,7 @@ pdf_document_get_text (EvDocument *document, int page, EvRectangle *rect)
        PopplerPage *poppler_page;
        PopplerRectangle r;
        double height;
+       char *text;
        
        poppler_page = poppler_document_get_page (pdf_document->document, page);
        set_page_orientation (pdf_document, poppler_page);
@@ -514,7 +521,11 @@ pdf_document_get_text (EvDocument *document, int page, EvRectangle *rect)
        r.x2 = rect->x2;
        r.y2 = height - rect->y1;
 
-       return poppler_page_get_text (poppler_page, &r);
+       text = poppler_page_get_text (poppler_page, &r);
+
+       g_object_unref (poppler_page);
+
+       return text;
 }
 
 static EvOrientation
@@ -810,6 +821,7 @@ make_thumbnail_for_size (PdfDocument *pdf_document,
                                       scale, pixbuf,
                                       x_offset, y_offset);
 
+       g_object_unref (poppler_page);
        return pixbuf;
 }
 
@@ -830,6 +842,7 @@ pdf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails
        g_return_val_if_fail (poppler_page != NULL, NULL);
 
        pixbuf = poppler_page_get_thumbnail (poppler_page);
+       
        if (pixbuf != NULL) {
                /* The document provides its own thumbnails. */
                if (border) {
@@ -843,6 +856,9 @@ pdf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails
                /* There is no provided thumbnail.  We need to make one. */
                pixbuf = make_thumbnail_for_size (pdf_document, page, size, border);
        }
+
+       g_object_unref (poppler_page);
+       
        return pixbuf;
 }
 
@@ -879,6 +895,7 @@ pdf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document_thumbnail
                        *height = size;
                }
        }
+       g_object_unref (poppler_page);
 }
 
 static void
@@ -906,6 +923,8 @@ pdf_document_search_idle_callback (void *data)
        matches = poppler_page_find_text (page, search->text);
        ev_document_doc_mutex_unlock ();
 
+       g_object_unref (page);
+
        search->pages[search->search_page] = matches;
        ev_document_find_changed (EV_DOCUMENT_FIND (pdf_document),
                                  search->search_page);
@@ -1043,7 +1062,8 @@ pdf_document_find_get_result (EvDocumentFind *document_find,
        rectangle->y1 = height - r->y2;
        rectangle->x2 = r->x2;
        rectangle->y2 = height - r->y1;
-       
+       g_object_unref (poppler_page);
+               
        return TRUE;
 }
 
@@ -1126,6 +1146,7 @@ pdf_document_ps_exporter_do_page (EvPSExporter *exporter, int page)
        poppler_page = poppler_document_get_page (pdf_document->document, page);
        set_page_orientation (pdf_document, poppler_page);
        poppler_page_render_to_ps (poppler_page, pdf_document->ps_file);
+       g_object_unref (poppler_page);
 }
 
 static void
index 55f2ddb341d787c29835781fea65e270e41708e4..58dac08ca9f835ed39c9688dc128c00bf8a3f80d 100644 (file)
@@ -578,11 +578,12 @@ job_finished_callback (EvJobLinks     *job,
        GtkTreeSelection *selection;
 
        priv = sidebar_links->priv;
-
-       priv->model = g_object_ref (job->model);
+       
+       priv->model = job->model;
        g_object_notify (G_OBJECT (sidebar_links), "model");
 
        gtk_tree_view_set_model (GTK_TREE_VIEW (priv->tree_view), job->model);
+       
        g_object_unref (job);
        priv->job = NULL;
 
index 5cc6f57d549ec305d375d6cffa1c23ca18196793..f9f7206938e8e506f67d1ca041a672bdab7b206e 100644 (file)
@@ -2481,6 +2481,7 @@ update_find_status_message (EvView *view)
 
        }
        ev_view_set_find_status (view, message);
+       g_free (message);
 }
 
 const char *