[gedit-code-assistance] Chain up on dispose



commit 9be29744527d84d34300c677ea34ac3c92440188
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sun Mar 4 20:12:01 2012 +0100

    Chain up on dispose

 src/gcp-document.vala |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/src/gcp-document.vala b/src/gcp-document.vala
index 345e184..a308027 100644
--- a/src/gcp-document.vala
+++ b/src/gcp-document.vala
@@ -103,26 +103,26 @@ class Document : GLib.Object
 
 	public override void dispose()
 	{
-		if (d_dispose_ran)
+		if (!d_dispose_ran)
 		{
-			return;
-		}
+			d_dispose_ran = true;
 
-		d_dispose_ran = true;
+			d_document.modified_changed.disconnect(on_document_modified_changed);
+			d_document.notify["location"].disconnect(on_location_changed);
 
-		d_document.modified_changed.disconnect(on_document_modified_changed);
-		d_document.notify["location"].disconnect(on_location_changed);
+			d_document.end_user_action.disconnect(on_document_end_user_action);
+			d_document.saved.disconnect(on_document_saved);
 
-		d_document.end_user_action.disconnect(on_document_end_user_action);
-		d_document.saved.disconnect(on_document_saved);
+			DiagnosticSupport diag = this as DiagnosticSupport;
 
-		DiagnosticSupport diag = this as DiagnosticSupport;
-
-		if (diag != null)
-		{
-			diag.diagnostics_updated.disconnect(on_diagnostic_updated);
-			remove_marks();
+			if (diag != null)
+			{
+				diag.diagnostics_updated.disconnect(on_diagnostic_updated);
+				remove_marks();
+			}
 		}
+
+		base.dispose();
 	}
 
 	private bool source_location(SourceLocation location, out TextIter iter)



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