- fixed memory leak caused by not freeing PangoLayout objects
- fixed memory leak caused by not freeing PangoLayout objects
git-svn-id: https://lampka.siedziba.pl:790/svn/repos/lingot-win32@300 455248ca-bdda-0310-9134-f4ebb693071a
diff --git a/src/lingot-mainframe.c b/src/lingot-mainframe.c
index 39c13d4..5fcfdad 100644
--- a/src/lingot-mainframe.c
+++ b/src/lingot-mainframe.c
@@ -616,6 +616,7 @@ void lingot_mainframe_draw_spectrum(LingotMainFrame* frame) {
pango_layout_set_font_description(layout, spectrum_legend_font_desc);
gdk_draw_layout(window, gc, spectrum_x_margin - 8 + i, spectrum_size_y
+ spectrum_top_margin + 5, layout);
+ g_object_unref(layout);
freq += scale;
}
@@ -626,6 +627,7 @@ void lingot_mainframe_draw_spectrum(LingotMainFrame* frame) {
layout = gtk_widget_create_pango_layout(frame->spectrum_area, buff);
pango_layout_set_font_description(layout, spectrum_legend_font_desc);
gdk_draw_layout(window, gc, spectrum_x_margin - 6, 2, layout);
+ g_object_unref(layout);
int grid_height = (int) (PLOT_GAIN*log10(pow(10.0, grid_db_height/10.0))); // dB.
j = 0;
@@ -639,6 +641,7 @@ void lingot_mainframe_draw_spectrum(LingotMainFrame* frame) {
pango_layout_set_font_description(layout, spectrum_legend_font_desc);
gdk_draw_layout(window, gc, 2, spectrum_size_y + spectrum_top_margin
- i - 5, layout);
+ g_object_unref(layout);
gdk_draw_line(window, gc, spectrum_x_margin, spectrum_size_y
+ spectrum_top_margin - i, spectrum_x_margin + spectrum_size_x,