1. TortoiseHg
  2. TortoiseHg
  3. thg

Commits

Yuya Nishihara  committed 3755bf2

thgrepo: block pending signals once filesystem monitoring is stopped

It seems QFileSystemWatcher processes queued OS events even if all paths
are removed. As a result, repositoryDestroyed signal is emitted repeatedly.

  • Participants
  • Parent commits 9c88ccf
  • Branches default

Comments (0)

Files changed (1)

File tortoisehg/hgqt/thgrepo.py

View file
         self._fswatcher.addPath(hglib.tounicode(self.repo.path))
         self._fswatcher.addPath(hglib.tounicode(self.repo.path + '/store'))
         self.addMissingPaths()
+        self._fswatcher.blockSignals(False)
 
     def stopMonitoring(self):
         """Stop filesystem monitoring by removing all watched paths"""
         if not self._fswatcher:
             return
+        self._fswatcher.blockSignals(True)  # ignore pending events
         dirs = self._fswatcher.directories()
         if dirs:
             self._fswatcher.removePaths(dirs)