SF.net SVN: geany:[4602] branches/geany-0.18.1
eht16 at users.sourceforge.net
eht16 at xxxxx
Sun Jan 31 16:23:00 UTC 2010
Revision: 4602
http://geany.svn.sourceforge.net/geany/?rev=4602&view=rev
Author: eht16
Date: 2010-01-31 16:22:59 +0000 (Sun, 31 Jan 2010)
Log Message:
-----------
Backport from trunk:
Plug a small memory leak and improve function signature of add_page_header().
Modified Paths:
--------------
branches/geany-0.18.1/ChangeLog
branches/geany-0.18.1/src/printing.c
Modified: branches/geany-0.18.1/ChangeLog
===================================================================
--- branches/geany-0.18.1/ChangeLog 2010-01-31 16:22:45 UTC (rev 4601)
+++ branches/geany-0.18.1/ChangeLog 2010-01-31 16:22:59 UTC (rev 4602)
@@ -83,6 +83,8 @@
* src/printing.c:
Fix wrong alignment of printed pages when page headers are
disabled (closes #2856822).
+ Plug a small memory leak and improve function signature of
+ add_page_header().
2009-09-15 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: branches/geany-0.18.1/src/printing.c
===================================================================
--- branches/geany-0.18.1/src/printing.c 2010-01-31 16:22:45 UTC (rev 4601)
+++ branches/geany-0.18.1/src/printing.c 2010-01-31 16:22:59 UTC (rev 4602)
@@ -270,7 +270,7 @@
}
-static void add_page_header(PangoLayout *layout, cairo_t *cr, DocInfo *dinfo, gint width, gint page_nr)
+static void add_page_header(DocInfo *dinfo, cairo_t *cr, gint width, gint page_nr)
{
gint ph_height = dinfo->line_height * 3;
gchar *data;
@@ -279,6 +279,7 @@
dinfo->doc->file_name : GEANY_STRING_UNTITLED;
gchar *file_name = (printing_prefs.page_header_basename) ?
g_path_get_basename(tmp_file_name) : g_strdup(tmp_file_name);
+ PangoLayout *layout = dinfo->layout;
/* draw the frame */
cairo_set_line_width(cr, 0.3);
@@ -526,6 +527,7 @@
gchar *text = g_strdup_printf(_("Page %d of %d"), page_nr, dinfo->n_pages);
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(main_widgets.progressbar), fraction);
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(main_widgets.progressbar), text);
+ g_free(text);
}
#ifdef GEANY_PRINT_DEBUG
@@ -552,7 +554,7 @@
pango_layout_set_justify(dinfo->layout, FALSE);
if (printing_prefs.print_page_header)
- add_page_header(dinfo->layout, cr, dinfo, width, page_nr);
+ add_page_header(dinfo, cr, width, page_nr);
count = 0; /* the actual line counter for the current page, might be different from
* dinfo->cur_line due to possible line breaks */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list