Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 02 May 2024 21:52:06 UTC Commit: d0192a3621e2505f2fcf6bc1c390278b2396749e https://github.com/geany/geany-plugins/commit/d0192a3621e2505f2fcf6bc1c39027...
Log Message: ----------- addons: Fix memory leak detected by cppcheck
Modified Paths: -------------- addons/src/ao_tasks.c
Modified: addons/src/ao_tasks.c 11 lines changed, 7 insertions(+), 4 deletions(-) =================================================================== @@ -636,18 +636,21 @@ static void free_update_tasks_for_doc_arguments(gpointer data)
static void update_tasks_for_doc(AoTasks *t, GeanyDocument *doc, gboolean clear) { - AoTasksUpdateTasksForDocArguments *arguments = g_slice_alloc(sizeof *arguments); - arguments->t = t; - arguments->doc = doc; - arguments->clear = clear; + AoTasksUpdateTasksForDocArguments *arguments;
if (!DOC_VALID(doc)) return;
+ arguments = g_slice_alloc(sizeof *arguments); + arguments->t = t; + arguments->doc = doc; + arguments->clear = clear; + /* Check for task tokens in an idle callback to wait until Geany applied Scintilla highlighting * styles as we need them to be set before checking for tasks. */ g_idle_add_full(G_PRIORITY_LOW, update_tasks_for_doc_idle_cb, arguments, free_update_tasks_for_doc_arguments); + /* cppcheck-suppress memleak symbolName=arguments */ }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org