Commits

Yuya Nishihara committed 7c5678d

import: eliminate reference cycle caused by lambda slot

Now ImportDialog can be deleted by refcount.

Comments (0)

Files changed (3)

tortoisehg/hgqt/mq.py

             super(MQWidget, self).dropEvent(event)
             return
         dlg = thgimport.ImportDialog(self.repo, self, mq=True)
-        dlg.finished.connect(dlg.deleteLater)
         dlg.setfilepaths(patches)
         dlg.exec_()
 

tortoisehg/hgqt/repowidget.py

 
     def thgimport(self, paths=None):
         dlg = thgimport.ImportDialog(self.repo, self)
-        dlg.finished.connect(dlg.deleteLater)
         dlg.patchImported.connect(self.gotoTip)
         if paths:
             dlg.setfilepaths(paths)

tortoisehg/hgqt/thgimport.py

         box.addWidget(buttons)
 
         # signal handlers
-        self.src_combo.editTextChanged.connect(lambda *a: self.preview())
+        self.src_combo.editTextChanged.connect(self.preview)
         self.src_combo.lineEdit().returnPressed.connect(self.thgimport)
-        self.p0chk.toggled.connect(lambda *a: self.preview())
+        self.p0chk.toggled.connect(self.preview)
 
         # dialog setting
         self.setLayout(box)