diff options
Diffstat (limited to 'libview/ev-view.c')
-rw-r--r-- | libview/ev-view.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c index 801dfda3..0c452237 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -7357,7 +7357,7 @@ compute_new_selection_rect (EvView *view, if (gdk_rectangle_intersect (&page_area, &view_rect, &overlap)) { EvViewSelection *selection; - selection = g_new0 (EvViewSelection, 1); + selection = g_slice_new0 (EvViewSelection); selection->page = i; _ev_view_transform_view_rect_to_doc_rect (view, &overlap, &page_area, &(selection->rect)); @@ -7435,7 +7435,7 @@ compute_new_selection_text (EvView *view, get_doc_page_size (view, i, &width, &height); - selection = g_new0 (EvViewSelection, 1); + selection = g_slice_new0 (EvViewSelection); selection->page = i; selection->style = style; selection->rect.x1 = selection->rect.y1 = 0; @@ -7489,8 +7489,7 @@ merge_selection_region (EvView *view, /* Update the selection */ old_list = ev_pixbuf_cache_get_selection_list (view->pixbuf_cache); - g_list_foreach (view->selection_info.selections, (GFunc)selection_free, NULL); - g_list_free (view->selection_info.selections); + g_list_free_full (view->selection_info.selections, (GDestroyNotify)selection_free); view->selection_info.selections = new_list; ev_pixbuf_cache_set_selection_list (view->pixbuf_cache, new_list); g_signal_emit (view, signals[SIGNAL_SELECTION_CHANGED], 0, NULL); @@ -7607,8 +7606,7 @@ merge_selection_region (EvView *view, } /* Free the old list, now that we're done with it. */ - g_list_foreach (old_list, (GFunc) selection_free, NULL); - g_list_free (old_list); + g_list_free_full (old_list, (GDestroyNotify)selection_free); } static void @@ -7633,15 +7631,14 @@ selection_free (EvViewSelection *selection) { if (selection->covered_region) cairo_region_destroy (selection->covered_region); - g_free (selection); + g_slice_free (EvViewSelection, selection); } static void clear_selection (EvView *view) { if (view->selection_info.selections) { - g_list_foreach (view->selection_info.selections, (GFunc)selection_free, NULL); - g_list_free (view->selection_info.selections); + g_list_free_full (view->selection_info.selections, (GDestroyNotify)selection_free); view->selection_info.selections = NULL; g_signal_emit (view, signals[SIGNAL_SELECTION_CHANGED], 0, NULL); @@ -7670,7 +7667,7 @@ ev_view_select_all (EvView *view) get_doc_page_size (view, i, &width, &height); - selection = g_new0 (EvViewSelection, 1); + selection = g_slice_new0 (EvViewSelection); selection->page = i; selection->style = EV_SELECTION_STYLE_GLYPH; selection->rect.x1 = selection->rect.y1 = 0; |