Update of /project/elephant/cvsroot/elephant/src In directory common-lisp.net:/tmp/cvs-serv14824/src
Modified Files: controller.lisp Log Message: incorporated Rafal Strzalinski's fix (don't close environments / db's twice)
Date: Sat Sep 4 10:28:45 2004 Author: blee
Index: elephant/src/controller.lisp diff -u elephant/src/controller.lisp:1.8 elephant/src/controller.lisp:1.9 --- elephant/src/controller.lisp:1.8 Sat Sep 4 10:16:55 2004 +++ elephant/src/controller.lisp Sat Sep 4 10:28:44 2004 @@ -146,16 +146,17 @@ (defmethod close-controller ((sc store-controller)) "Close the db handles and environment. Tries to wipe out references to the db handles." - ; no root - (setf (slot-value sc 'root) nil) - ; clean instance cache - (setf (instance-cache sc) (make-cache-table :test 'eql)) - ; close environment - (db-close (controller-db sc)) - (setf (controller-db sc) nil) - (db-env-close (controller-environment sc)) - (setf (controller-environment sc) nil) - nil) + (when (slot-value sc 'root) + ;; no root + (setf (slot-value sc 'root) nil) + ;; clean instance cache + (setf (instance-cache sc) (make-cache-table :test 'eql)) + ;; close environment + (db-close (controller-db sc)) + (setf (controller-db sc) nil) + (db-env-close (controller-environment sc)) + (setf (controller-environment sc) nil) + nil))
(defmacro with-open-controller ((&optional (sc '*store-controller*)) &body body)