aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColomban Wendling <ban@herbesfolles.org>2014-08-08 20:25:07 +0200
committerColomban Wendling <ban@herbesfolles.org>2014-08-08 20:25:07 +0200
commitebba00cd6e61d2036b9e1bca16ccb7661381a682 (patch)
tree9390edb3deda057d066e42a26b1097fef60979f2
parentbe4645be814ee6a9a6cd6c3cb92f6ba33747f42a (diff)
downloadscintilla-mirror-ebba00cd6e61d2036b9e1bca16ccb7661381a682.tar.gz
Fix leak in ListBox::GetSelection() on GTK
-rw-r--r--gtk/PlatGTK.cxx6
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) {