1. TortoiseHg
  2. TortoiseHg
  3. thg


Yuya Nishihara  committed 7031491

fileview: manage deletion and connection of QTimer in C++ layer (fixes #2554)

HgFileView has several reference cycles, so Python-part of HgFileView cannot
be destroyed by refcounting.

`QTimer(self)` makes sure to delete QTimer instance when C++-part of HgFileView
is destroyed. Also, @pyqtSlot decorator will assist to clean up stale
signal-slot connections.

  • Participants
  • Parent commits 911ab71
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/fileview.py

View file
-        self.timer = QTimer()
+        self.timer = QTimer(self)
     # file mode diff markers
+    @pyqtSlot()
     def timerBuildDiffMarkers(self):
         'show modified and added lines in the self.blk margin'
         # The way the diff markers are generated differs between the DiffMode