summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLogan Rathbone <poprocks@gmail.com>2022-05-05 02:10:25 +0000
committerLogan Rathbone <poprocks@gmail.com>2022-05-05 02:10:25 +0000
commit4d68baf5ef102b51f5a3af0b5fd80bef76e9d789 (patch)
treea0ab67ef99c55d81df5963c66b605e395f9a1278
parentf5b9619b2fe2968f6f95df75d5e58c574f4568fe (diff)
parent596d09a78fe1138e1ec4cba56b269631985e6b74 (diff)
downloadlibnotify-4d68baf5ef102b51f5a3af0b5fd80bef76e9d789.tar.gz
Merge branch 'fix-electron-crash' into 'master'
Closes #25 See merge request GNOME/libnotify!26
-rw-r--r--libnotify/notification.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libnotify/notification.c b/libnotify/notification.c
index 482ee3e..18d7203 100644
--- a/libnotify/notification.c
+++ b/libnotify/notification.c
@@ -739,12 +739,19 @@ proxy_g_signal_cb (GDBusProxy *proxy,
g_warning ("Received unknown action %s", action);
}
} else {
+ /* Some clients have assumed it is safe to unref the
+ * Notification at the end of their NotifyActionCallback
+ * so we add a temporary ref until we're done with it.
+ */
+ g_object_ref (notification);
+
notification->priv->activating = TRUE;
pair->cb (notification, (char *) action, pair->user_data);
notification->priv->activating = FALSE;
-
g_free (notification->priv->activation_token);
notification->priv->activation_token = NULL;
+
+ g_object_unref (notification);
}
} else if (g_strcmp0 (signal_name, "ActivationToken") == 0 &&
g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(us)"))) {