code: def finalize(self):
          
          self.model().sigItemChanged.disconnect(self.repoTreeItemChanged)
  
          selectionModel = self.selectionModel() # need to store reference to prevent crash in PySide
          selectionModel.currentChanged.disconnect(self.currentItemChanged)
docs: Disconnects signals and frees resources