aboutsummaryrefslogtreecommitdiff
path: root/libmessaging-menu
diff options
context:
space:
mode:
Diffstat (limited to 'libmessaging-menu')
-rw-r--r--libmessaging-menu/messaging-menu-app.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libmessaging-menu/messaging-menu-app.c b/libmessaging-menu/messaging-menu-app.c
index 7fc9106..a0180cb 100644
--- a/libmessaging-menu/messaging-menu-app.c
+++ b/libmessaging-menu/messaging-menu-app.c
@@ -1397,7 +1397,11 @@ void
messaging_menu_app_remove_message (MessagingMenuApp *app,
MessagingMenuMessage *msg)
{
+ /* take a ref of @msg here to make sure the pointer returned by
+ * _get_id() is valid for the duration of remove_message_by_id. */
+ g_object_ref (msg);
messaging_menu_app_remove_message_by_id (app, messaging_menu_message_get_id (msg));
+ g_object_unref (msg);
}
/**