[empathy] log-window: check if the window still exist in async cb (#622273)



commit 9f52496c8d0d54e898b3d9df419201617417bdba
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Jun 22 15:00:54 2010 +0200

    log-window: check if the window still exist in async cb (#622273)

 libempathy-gtk/empathy-log-window.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 31f1ca2..50eadb0 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -155,6 +155,9 @@ account_manager_prepared_cb (GObject *source_object,
 	GList *accounts;
 	GError *error = NULL;
 
+	if (log_window == NULL)
+		return;
+
 	if (!tp_account_manager_prepare_finish (account_manager, result, &error)) {
 		DEBUG ("Failed to prepare account manager: %s", error->message);
 		g_error_free (error);
@@ -358,6 +361,9 @@ got_messages_for_date_cb (GObject *manager,
 	gboolean       can_do_next;
 	GError        *error = NULL;
 
+	if (log_window == NULL)
+		return;
+
 	if (!tpl_log_manager_get_messages_for_date_finish (TPL_LOG_MANAGER (manager),
 		result, &messages, &error)) {
 			DEBUG ("Unable to retrieve messages for the selected date: %s. Aborting",
@@ -494,6 +500,9 @@ log_manager_searched_new_cb (GObject *manager,
 	GtkListStore        *store = user_data;
 	GError              *error = NULL;
 
+	if (log_window == NULL)
+		return;
+
 	if (!tpl_log_manager_search_finish (TPL_LOG_MANAGER (manager), result,
 		&hits, &error)) {
 			DEBUG ("%s. Aborting", error->message);
@@ -767,6 +776,9 @@ log_manager_got_chats_cb (GObject *manager,
 	GtkTreeIter            iter;
 	GError                *error = NULL;
 
+	if (log_window == NULL)
+		return;
+
 	if (!tpl_log_manager_get_chats_finish (TPL_LOG_MANAGER (manager),
 		result, &chats, &error)) {
 			DEBUG ("%s. Aborting", error->message);
@@ -1023,6 +1035,9 @@ log_window_got_messages_for_date_cb (GObject *manager,
   GList *l;
   GError *error = NULL;
 
+  if (log_window == NULL)
+    return;
+
   if (!tpl_log_manager_get_messages_for_date_finish (TPL_LOG_MANAGER (manager),
         result, &messages, &error)) {
       DEBUG ("Unable to retrieve messages for the selected date: %s. Aborting",
@@ -1094,6 +1109,9 @@ log_manager_got_dates_cb (GObject *manager,
   GDate         *date = NULL;
   GError        *error = NULL;
 
+  if (log_window == NULL)
+    return;
+
   if (!tpl_log_manager_get_dates_finish (TPL_LOG_MANAGER (manager),
         result, &dates, &error)) {
     DEBUG ("Unable to retrieve messages' dates: %s. Aborting",
@@ -1251,6 +1269,9 @@ log_window_updating_calendar_month_cb (GObject *manager,
 	guint					 month_selected;
 	GError				*error = NULL;
 
+	if (log_window == NULL)
+		return;
+
 	if (!tpl_log_manager_get_dates_finish (TPL_LOG_MANAGER (manager),
 		result, &dates, &error)) {
 			DEBUG ("Unable to retrieve messages' dates: %s. Aborting",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]