[gnome-bluetooth] Avoid crashing when there's an error on the last sent file



commit d388a591a73148d0a83057865419b93d388a0b02
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Dec 14 16:57:03 2009 +0000

    Avoid crashing when there's an error on the last sent file

 sendto/main.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/sendto/main.c b/sendto/main.c
index e12a901..7d526d2 100644
--- a/sendto/main.c
+++ b/sendto/main.c
@@ -550,6 +550,8 @@ static gboolean release_callback(DBusGMethodInvocation *context,
 {
 	dbus_g_method_return(context);
 
+	agent = NULL;
+
 	gtk_label_set_markup(GTK_LABEL(label_status), NULL);
 
 	gtk_widget_destroy(dialog);
@@ -574,8 +576,10 @@ static gboolean error_callback(DBusGMethodInvocation *context,
 	g_object_unref (current_transfer);
 	current_transfer = NULL;
 
-	obex_agent_set_release_func(agent, NULL, NULL);
-	agent = NULL;
+	if (agent != NULL) {
+		obex_agent_set_release_func(agent, NULL, NULL);
+		agent = NULL;
+	}
 
 	dbus_g_method_return(context);
 



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