[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [oxygen-gtk] demo: Explicitly free tree path contained in list before freeing list, to prevent mem l
From: Hugo Pereira Da Costa <hugo () oxygen-icons ! org>
Date: 2014-01-19 19:32:17
Message-ID: E1W4y6T-0003wR-Ft () scm ! kde ! org
[Download RAW message or body]
Git commit 36ec8bd06095f2ae41415543aba808d509703f85 by Hugo Pereira Da Costa.
Committed on 17/01/2014 at 14:09.
Pushed by hpereiradacosta into branch 'master'.
Explicitly free tree path contained in list before freeing list, to prevent mem leak
(somehow g_list_free does not free the content in this case)
M +5 -0 demo/oxygendemodialog.cpp
http://commits.kde.org/oxygen-gtk/36ec8bd06095f2ae41415543aba808d509703f85
diff --git a/demo/oxygendemodialog.cpp b/demo/oxygendemodialog.cpp
index 7eee041..59f3a2a 100644
--- a/demo/oxygendemodialog.cpp
+++ b/demo/oxygendemodialog.cpp
@@ -228,6 +228,11 @@ namespace Oxygen
GtkTreePath* path( static_cast<GtkTreePath*>( g_list_first( selection )->data ) );
const int page( gtk_tree_path_get_indices( path )[0] );
gtk_notebook_set_current_page( GTK_NOTEBOOK( dialog._notebook ), page );
+
+ // explicitly free path contained in list to avoir mem leak, before calling g_list_free
+ for( GList *child = g_list_first( selection ); child; child = g_list_next( child ) )
+ { gtk_tree_path_free( static_cast<GtkTreePath*>( child->data ) ); }
+
g_list_free( selection );
// store enable state
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic