diff options
author | Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> | 2012-04-24 20:59:12 +0200 |
---|---|---|
committer | Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> | 2012-04-24 20:59:12 +0200 |
commit | b54c086b192388bdec1ac0b532c6247fb861b78c (patch) | |
tree | bc846f73c0a2efd69adb1e64cde4ccfea4f9023d | |
parent | cdbed62d7950b543904b357baaaecd4841f8018a (diff) | |
download | zeitgeist-sgevatter/fts-locking.tar.gz |
FTS++: Make sure Xapian is closed before releasing the bus namesgevatter/fts-locking
-rw-r--r-- | extensions/fts++/zeitgeist-fts.vala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/extensions/fts++/zeitgeist-fts.vala b/extensions/fts++/zeitgeist-fts.vala index 7800a828..29ea1f4d 100644 --- a/extensions/fts++/zeitgeist-fts.vala +++ b/extensions/fts++/zeitgeist-fts.vala @@ -69,10 +69,10 @@ namespace Zeitgeist indexer = new Indexer (engine); } - private void do_quit () + private void close () { engine.close (); - mainloop.quit (); + indexer = null; // close the index } public void register_dbus_object (DBusConnection conn) throws IOError @@ -231,6 +231,10 @@ namespace Zeitgeist if (instance != null) { + // Close any database connections + instance.close (); + + // Release the bus name Bus.unown_name (owner_id); instance.unregister_dbus_object (); instance = null; @@ -249,7 +253,7 @@ namespace Zeitgeist static void safe_exit () { - instance.do_quit (); + mainloop.quit (); } static int main (string[] args) |