From 3d21fde5df0e80018aa03c87b1bf87b9f2a1d2fe Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Wed, 25 Aug 2010 17:00:38 +0000 Subject: [PATCH] Backport list box memory leak fixes from Scintilla 2.20. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5201 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 2 ++ scintilla/PlatGTK.cxx | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 803813160..25c474f60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ regex support is required. * tagmanager/make.c: Backport fix for possible infinite loop from CTags. + * scintilla/PlatGTK.cxx: + Backport list box memory leak fixes from Scintilla 2.20. 2010-08-24 Nick Treleaven diff --git a/scintilla/PlatGTK.cxx b/scintilla/PlatGTK.cxx index 9e84815e2..d632b9aa6 100644 --- a/scintilla/PlatGTK.cxx +++ b/scintilla/PlatGTK.cxx @@ -2245,8 +2245,10 @@ int ListBoxX::Find(const char *prefix) { gchar *s; gtk_tree_model_get(model, &iter, TEXT_COLUMN, &s, -1); if (s && (0 == strncmp(prefix, s, strlen(prefix)))) { + g_free(s); return i; } + g_free(s); valid = gtk_tree_model_iter_next(model, &iter) != FALSE; i++; } @@ -2267,6 +2269,7 @@ void ListBoxX::GetValue(int n, char *value, int len) { } else { value[0] = '\0'; } + g_free(text); } // g_return_if_fail causes unnecessary compiler warning in release compile.