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; }