Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/olpc/datastore/xapianindex.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/olpc/datastore/xapianindex.py')
-rw-r--r--src/olpc/datastore/xapianindex.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py
index 671035d..d653f0e 100644
--- a/src/olpc/datastore/xapianindex.py
+++ b/src/olpc/datastore/xapianindex.py
@@ -14,6 +14,7 @@ __license__ = 'The GNU Public License V2+'
from Queue import Queue, Empty
+import gc
import logging
import re
import sys
@@ -106,7 +107,15 @@ class IndexManager(object):
self.stopIndexer(force)
self.write_index.close()
self.read_index.close()
-
+ # XXX: work around for xapian not having close() this will
+ # change in the future in the meantime we delete the
+ # references to the indexers and then force the gc() to run
+ # which should inturn trigger the C++ destructor which forces
+ # the database shut.
+ self.write_index = None
+ self.read_index = None
+ gc.collect()
+
# Index thread management
def startIndexer(self):
self.indexer_running = True