Commit caa29938 authored by Dan Pascu's avatar Dan Pascu

Fixed memory leaks

parent 93cf1738
...@@ -157,6 +157,7 @@ class MainWindow(base_class, ui_class): ...@@ -157,6 +157,7 @@ class MainWindow(base_class, ui_class):
self.server_tools_account_model.rowsRemoved.connect(self._SH_ServerToolsAccountModelChanged) self.server_tools_account_model.rowsRemoved.connect(self._SH_ServerToolsAccountModelChanged)
self.session_model.sessionAdded.connect(self._SH_SessionModelAddedSession) self.session_model.sessionAdded.connect(self._SH_SessionModelAddedSession)
self.session_model.sessionRemoved.connect(self._SH_SessionModelRemovedSession)
self.session_model.structureChanged.connect(self._SH_SessionModelChangedStructure) self.session_model.structureChanged.connect(self._SH_SessionModelChangedStructure)
self.silent_button.clicked.connect(self._SH_SilentButtonClicked) self.silent_button.clicked.connect(self._SH_SilentButtonClicked)
...@@ -562,6 +563,10 @@ class MainWindow(base_class, ui_class): ...@@ -562,6 +563,10 @@ class MainWindow(base_class, ui_class):
if session_item.session.state is None: if session_item.session.state is None:
self.search_box.clear() self.search_box.clear()
def _SH_SessionModelRemovedSession(self, session_item):
if not self.session_model.rowCount():
self.switch_view_button.view = SwitchViewButton.ContactView
def _SH_SessionModelChangedStructure(self): def _SH_SessionModelChangedStructure(self):
active_sessions = self.session_model.active_sessions active_sessions = self.session_model.active_sessions
self.active_sessions_label.setText(u'There is 1 active call' if len(active_sessions)==1 else u'There are %d active calls' % len(active_sessions)) self.active_sessions_label.setText(u'There is 1 active call' if len(active_sessions)==1 else u'There are %d active calls' % len(active_sessions))
...@@ -611,8 +616,8 @@ class MainWindow(base_class, ui_class): ...@@ -611,8 +616,8 @@ class MainWindow(base_class, ui_class):
action = self.received_calls_menu.addAction(unicode(entry)) action = self.received_calls_menu.addAction(unicode(entry))
action.entry = entry action.entry = entry
def _SH_PendingWatcherDialogFinished(self, dialog, code): def _SH_PendingWatcherDialogFinished(self, result):
self.pending_watcher_dialogs.remove(dialog) self.pending_watcher_dialogs.remove(self.sender())
def _SH_SystemTrayIconActivated(self, reason): def _SH_SystemTrayIconActivated(self, reason):
if reason == QSystemTrayIcon.Trigger: if reason == QSystemTrayIcon.Trigger:
...@@ -773,7 +778,7 @@ class MainWindow(base_class, ui_class): ...@@ -773,7 +778,7 @@ class MainWindow(base_class, ui_class):
def _NH_SIPAccountGotPendingWatcher(self, notification): def _NH_SIPAccountGotPendingWatcher(self, notification):
dialog = PendingWatcherDialog(notification.sender, notification.data.uri, notification.data.display_name) dialog = PendingWatcherDialog(notification.sender, notification.data.uri, notification.data.display_name)
dialog.finished.connect(partial(self._SH_PendingWatcherDialogFinished, dialog)) dialog.finished.connect(self._SH_PendingWatcherDialogFinished)
self.pending_watcher_dialogs.append(dialog) self.pending_watcher_dialogs.append(dialog)
dialog.show() dialog.show()
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment