[gedit] Be more paranoid about a case that should never happen...



commit 4fe90116dc8407e91b1e37629b9f40a0e1cf7fe7
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Sep 12 18:45:23 2009 +0200

    Be more paranoid about a case that should never happen...

 plugins/modelines/gedit-modeline-plugin.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/plugins/modelines/gedit-modeline-plugin.c b/plugins/modelines/gedit-modeline-plugin.c
index 1fb03d1..ba6c9d5 100644
--- a/plugins/modelines/gedit-modeline-plugin.c
+++ b/plugins/modelines/gedit-modeline-plugin.c
@@ -156,10 +156,17 @@ disconnect_handlers (GeditView *view)
 
 	data = g_object_steal_data (G_OBJECT (doc), DOCUMENT_DATA_KEY);
 
-	g_signal_handler_disconnect (doc, data->document_loaded_handler_id);
-	g_signal_handler_disconnect (doc, data->document_saved_handler_id);
+	if (data)
+	{
+		g_signal_handler_disconnect (doc, data->document_loaded_handler_id);
+		g_signal_handler_disconnect (doc, data->document_saved_handler_id);
 
-	document_data_free (data);
+		document_data_free (data);
+	}
+	else
+	{
+		g_warning ("Modeline handlers not found");
+	}
 }
 
 static void



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