diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2014-08-08 20:25:07 +0200 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2014-08-08 20:25:07 +0200 |
commit | ebba2ef6a0491f441bda5c85e57b0e11965dd5f1 (patch) | |
tree | 525335c94581c4412a5ef9a1c2774c04f0623f74 | |
parent | 43443afc3e9f958f9678f5d6e83e05e3779add97 (diff) | |
download | scintilla-mirror-ebba2ef6a0491f441bda5c85e57b0e11965dd5f1.tar.gz |
Fix leak in ListBox::GetSelection() on GTK
-rw-r--r-- | gtk/PlatGTK.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index ac90dee2a..2637e5d99 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1805,6 +1805,7 @@ void ListBoxX::Select(int n) { } int ListBoxX::GetSelection() { + int index = -1; GtkTreeIter iter; GtkTreeModel *model; GtkTreeSelection *selection; @@ -1814,9 +1815,10 @@ int ListBoxX::GetSelection() { int *indices = gtk_tree_path_get_indices(path); // Don't free indices. if (indices) - return indices[0]; + index = indices[0]; + gtk_tree_path_free(path); } - return -1; + return index; } int ListBoxX::Find(const char *prefix) { |