[gedit-code-assistance/wip/arch] Implement dispose



commit 3afd48a546a8abb009a7003e0e0b8b1cc284ff54
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sun Nov 10 16:34:23 2013 +0100

    Implement dispose

 src/gca-backend.vala |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/gca-backend.vala b/src/gca-backend.vala
index ef73398..c14d081 100644
--- a/src/gca-backend.vala
+++ b/src/gca-backend.vala
@@ -101,8 +101,20 @@ class Backend : Object
                view.path_changed.connect(on_view_path_changed);
        }
 
+       private new void dispose(string path)
+       {
+               d_service.dispose.begin(path, (obj, res) => {
+                       try
+                       {
+                               d_service.dispose.end(res);
+                       } catch {}
+               });
+       }
+
        public void unregister(View view)
        {
+               dispose(view.document.path);
+
                view.changed.disconnect(on_view_changed);
                view.path_changed.disconnect(on_view_path_changed);
 
@@ -115,6 +127,7 @@ class Backend : Object
                if (prevpath != null)
                {
                        d_paths.unset(prevpath);
+                       dispose(prevpath);
                }
 
                d_paths[view.document.path] = view;


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