[gedit-code-assistance] Properly destruct document



commit 2b135985f28ca6c4a73f775a38134cf12781712e
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Sat Mar 3 16:00:19 2012 +0100

    Properly destruct document

 src/gcp-view.vala |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/gcp-view.vala b/src/gcp-view.vala
index b595998..e543594 100644
--- a/src/gcp-view.vala
+++ b/src/gcp-view.vala
@@ -189,6 +189,7 @@ class View : Object
 			d_semanticValue = null;
 		}
 
+		unregister_backend();
 		d_buffer = null;
 	}
 
@@ -290,12 +291,11 @@ class View : Object
 	private void update_backend()
 	{
 		/* Update the backend according to the current language on the buffer */
-		var lang = d_buffer.language;
-		Backend backend = null;
+		Backend? backend = null;
 
-		if (lang != null)
+		if (d_buffer != null && d_buffer.language != null)
 		{
-			backend = BackendManager.instance[lang.id];
+			backend = BackendManager.instance[d_buffer.language.id];
 		}
 
 		unregister_backend();



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