[gnome-builder/ebassi/gnome-app-template: 3/3] meson-templates: Plug a leak in the C template
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/ebassi/gnome-app-template: 3/3] meson-templates: Plug a leak in the C template
- Date: Fri, 11 Feb 2022 19:15:52 +0000 (UTC)
commit 1705b06c1d20df6b6f324375e69699fec0da7512
Author: Emmanuele Bassi <ebassi gnome org>
Date: Fri Feb 11 19:10:47 2022 +0000
meson-templates: Plug a leak in the C template
The GActionMap interface acquires a reference on the action added into
it, which means we need to drop the reference we have on the action.
src/plugins/meson-templates/resources/src/application.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/meson-templates/resources/src/application.c
b/src/plugins/meson-templates/resources/src/application.c
index 5ead16c47..2092c21f7 100644
--- a/src/plugins/meson-templates/resources/src/application.c
+++ b/src/plugins/meson-templates/resources/src/application.c
@@ -92,11 +92,11 @@ static void
static void
{{prefix_}}_application_init ({{PreFix}}Application *self)
{
- GSimpleAction *quit_action = g_simple_action_new ("quit", NULL);
+ g_autoptr (GSimpleAction) quit_action = g_simple_action_new ("quit", NULL);
g_signal_connect_swapped (quit_action, "activate", G_CALLBACK (g_application_quit), self);
g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (quit_action));
- GSimpleAction *about_action = g_simple_action_new ("about", NULL);
+ g_autoptr (GSimpleAction) about_action = g_simple_action_new ("about", NULL);
g_signal_connect (about_action, "activate", G_CALLBACK ({{prefix_}}_application_show_about), self);
g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (about_action));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]