obshashrange: properly drop the current connection on clear
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 12 May 2017 20:49:27 +0200
changeset 2362 22c35d07ddb3
parent 2361 5c5f982b98f7
child 2363 2ceb122fcc33
obshashrange: properly drop the current connection on clear
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Fri May 12 20:40:00 2017 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py	Fri May 12 20:49:27 2017 +0200
@@ -430,12 +430,14 @@
 
     def clear(self, reset=False):
         self._valid = False
-        super(_obshashcache, self).clear(reset=reset)
         if reset:
             con = self._con
             if con is not None:
                 con.execute(_reset)
+        super(_obshashcache, self).clear(reset=reset)
         self._new.clear()
+        if not reset and '_con' in vars(self):
+            del self._con
 
     def get(self, rangeid):
         # revision should be covered by out tiprev