Fix segfault when pressing ctrl-enter when there are no workspace

tags (thanks to R8Rooy for reporting).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1417 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2007-03-24 12:10:43 +00:00
parent b05c0a7f0e
commit 8ba7ffe9e6
3 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2007-03-24 Nick Treleaven <nick.treleaven@btinternet.com>
* src/sci_cb.c, src/symbols.c:
Fix segfault when pressing ctrl-enter when there are no workspace
tags (thanks to R8Rooy for reporting).
2007-03-23 Nick Treleaven <nick.treleaven@btinternet.com> 2007-03-23 Nick Treleaven <nick.treleaven@btinternet.com>
* src/dialogs.c: * src/dialogs.c:

View File

@ -1159,6 +1159,8 @@ void sci_cb_show_macro_list(ScintillaObject *sci)
if (sci == NULL) return; if (sci == NULL) return;
words = symbols_get_macro_list(); words = symbols_get_macro_list();
if (words == NULL) return;
SSM(sci, SCI_USERLISTSHOW, 1, (sptr_t) words->str); SSM(sci, SCI_USERLISTSHOW, 1, (sptr_t) words->str);
g_string_free(words, TRUE); g_string_free(words, TRUE);
} }

View File

@ -200,6 +200,9 @@ GString *symbols_get_macro_list()
GPtrArray *ftags; GPtrArray *ftags;
GString *words; GString *words;
if (app->tm_workspace->work_objects == NULL)
return NULL;
ftags = g_ptr_array_sized_new(50); ftags = g_ptr_array_sized_new(50);
words = g_string_sized_new(200); words = g_string_sized_new(200);