From 8df226ec29605ce8e68b45c9e5b4965a4f3a9b76 Mon Sep 17 00:00:00 2001 From: LAGonauta Date: Mon, 22 Feb 2021 06:23:08 -0300 Subject: [PATCH] Increase ref on event token --- .../api/src/gobject/winrt-event-token.cpp | 4 ++-- .../api/src/gobject/winrt-toast-notification.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/windows-notification/api/src/gobject/winrt-event-token.cpp b/plugins/windows-notification/api/src/gobject/winrt-event-token.cpp index 2981c2b0..617f3878 100644 --- a/plugins/windows-notification/api/src/gobject/winrt-event-token.cpp +++ b/plugins/windows-notification/api/src/gobject/winrt-event-token.cpp @@ -56,8 +56,8 @@ winrt::event_token* winrt_event_token_get_internal(winrtEventToken *self) winrtEventToken* winrt_event_token_new_from_token(winrt::event_token* token) { auto ret = static_cast(g_object_new (WINRT_TYPE_EVENT_TOKEN, NULL)); -// winrtEventTokenPrivate* priv = WINRT_EVENT_TOKEN_GET_PRIVATE(ret); -// priv->token = new winrt::event_token(*token); + winrtEventTokenPrivate* priv = WINRT_EVENT_TOKEN_GET_PRIVATE(ret); + priv->token = new winrt::event_token(*token); return ret; } diff --git a/plugins/windows-notification/api/src/gobject/winrt-toast-notification.cpp b/plugins/windows-notification/api/src/gobject/winrt-toast-notification.cpp index 00cad570..c1623d7c 100644 --- a/plugins/windows-notification/api/src/gobject/winrt-toast-notification.cpp +++ b/plugins/windows-notification/api/src/gobject/winrt-toast-notification.cpp @@ -252,6 +252,7 @@ winrtEventToken* winrt_windows_ui_notifications_toast_notification_Activated(win priv->activated.callback(wsview_to_char(arguments.data()), nullptr /* user_input */ , 0 /* user_input.size() */, priv->activated.context); }); priv->activated.token = winrt_event_token_new_from_token(&token); + g_object_ref(priv->activated.token); return priv->activated.token; }