aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-status-icon.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-08-05 05:29:56 +0800
committerWill Thompson <will.thompson@collabora.co.uk>2009-08-05 05:35:54 +0800
commitfaef8889c4331af839cbec91691fe97ade60f9f7 (patch)
tree6469d6745819702996b3fca426f117e7e4145ac2 /src/empathy-status-icon.c
parent485ccb5ac65dc8beccd511c9575c3f58ae52d047 (diff)
downloadgsoc2013-empathy-faef8889c4331af839cbec91691fe97ade60f9f7.tar.gz
gsoc2013-empathy-faef8889c4331af839cbec91691fe97ade60f9f7.tar.zst
gsoc2013-empathy-faef8889c4331af839cbec91691fe97ade60f9f7.zip
Don't try to free NULL pixbufs.
It's all very well to ensure that we don't pass a NULL pixbuf to libnotify, but we shouldn't then try to g_object_unref () the pointer without checking it's not NULL.
Diffstat (limited to 'src/empathy-status-icon.c')
-rw-r--r--src/empathy-status-icon.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index 1f6a32c95..79e59c5f5 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -140,9 +140,6 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
if (priv->event) {
gchar *message_esc = g_markup_escape_text (priv->event->message, -1);
- pixbuf = empathy_misc_get_pixbuf_for_notification (priv->event->contact,
- priv->event->icon_name);
-
if (priv->notification) {
notify_notification_update (priv->notification,
priv->event->header, message_esc,
@@ -155,15 +152,19 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
g_signal_connect (priv->notification, "closed",
G_CALLBACK (status_icon_notification_closed_cb), icon);
+ }
- }
- /* if icon doesn't exist libnotify will crash */
- if (pixbuf != NULL)
+ pixbuf = empathy_misc_get_pixbuf_for_notification (priv->event->contact,
+ priv->event->icon_name);
+
+ if (pixbuf != NULL) {
notify_notification_set_icon_from_pixbuf (priv->notification,
pixbuf);
+ g_object_unref (pixbuf);
+ }
+
notify_notification_show (priv->notification, NULL);
- g_object_unref (pixbuf);
g_free (message_esc);
} else {
notification_close_helper (priv);