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
commitebba2ef6a0491f441bda5c85e57b0e11965dd5f1 (patch)
tree525335c94581c4412a5ef9a1c2774c04f0623f74
parent43443afc3e9f958f9678f5d6e83e05e3779add97 (diff)
downloadscintilla-mirror-ebba2ef6a0491f441bda5c85e57b0e11965dd5f1.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) {