Skip to content
Snippets Groups Projects
Commit 6005564c authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

[#1403] Prevent crash when hangup && no notification

parent ad911b2a
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ void create_new_gnome_notification (gchar *title, gchar *body, NotifyUrgency urg ...@@ -34,7 +34,7 @@ void create_new_gnome_notification (gchar *title, gchar *body, NotifyUrgency urg
// Set struct fields // Set struct fields
_notif->notification = notify_notification_new (title, body, NULL, NULL); _notif->notification = notify_notification_new (title, body, NULL, NULL);
//_notif->icon = gdk_pixbuf_new_from_file_at_size (LOGO, 120, 120, NULL); //_notif->icon = gdk_pixbuf_new_from_file_at_size (LOGO, 120, 120, NULL);
_notif->icon = gdk_pixbuf_new_from_file (LOGO, NULL); _notif->icon = gdk_pixbuf_new_from_file (LOGO_SMALL, NULL);
#if GTK_CHECK_VERSION(2,10,0) #if GTK_CHECK_VERSION(2,10,0)
notify_notification_attach_to_status_icon (_notif->notification , get_status_icon() ); notify_notification_attach_to_status_icon (_notif->notification , get_status_icon() );
#endif #endif
...@@ -157,17 +157,16 @@ notify_no_registered_accounts () ...@@ -157,17 +157,16 @@ notify_no_registered_accounts ()
void void
stop_notification( void ) stop_notification( void )
{ {
if( _gnome_notification->notification != NULL ) if( _gnome_notification != NULL )
{ {
if(notify_notification_show (_gnome_notification->notification, NULL)) if(_gnome_notification->notification != NULL)
{ {
notify_notification_close (_gnome_notification->notification, NULL); notify_notification_close (_gnome_notification->notification, NULL);
g_object_unref(_gnome_notification->notification ); g_object_unref(_gnome_notification->notification );
_gnome_notification->notification = NULL; _gnome_notification->notification = NULL;
} }
_gnome_notification->notification = NULL; free_notification (_gnome_notification);
} }
//free_notification (_gnome_notification);
} }
/** /**
...@@ -178,6 +177,5 @@ void free_notification (GnomeNotification *g) ...@@ -178,6 +177,5 @@ void free_notification (GnomeNotification *g)
g_free(g->title); g_free(g->title);
g_free(g->body); g_free(g->body);
g_free(g->notification); g_free(g->notification);
g_free(g->icon);
g_free(g); g_free(g);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment