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
This commit is contained in:
Nick Treleaven 2010-08-25 17:00:38 +00:00
parent 87ddff9707
commit 3d21fde5df
2 changed files with 5 additions and 0 deletions

View File

@ -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 <nick(dot)treleaven(at)btinternet(dot)com>

View File

@ -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.