diff options
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 22 | ||||
-rw-r--r-- | src/leap/bitmask/gui/signaltracker.py | 13 | ||||
-rw-r--r-- | src/leap/bitmask/gui/wizard.py | 3 |
3 files changed, 31 insertions, 7 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 7d55a5d5..b0826303 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -288,7 +288,11 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): if self._first_run(): self._wizard_firstrun = True - self.disconnect_and_untrack() + + # HACK FIX: disconnection of signals triggers a reconnection later + # chich segfaults on wizard quit + # self.disconnect_and_untrack() + self._wizard = Wizard(backend=self._backend, leap_signaler=self._leap_signaler) # Give this window time to finish init and then show the wizard @@ -341,6 +345,8 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): conntrack = self.connect_and_track # XXX does this goes in here? this will be triggered when the login or # wizard requests provider data + + # XXX - here segfaults if we did a disconnect_and_untrack conntrack(sig.prov_check_api_certificate, self._get_provider_details) conntrack(sig.prov_get_details, self._provider_get_details) @@ -417,7 +423,11 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # This happens if the user finishes the provider # setup but does not register self._wizard = None - self._backend_connect(only_tracked=True) + + # HACK FIX: disconnection of signals triggers a reconnection later + # chich segfaults on wizard quit + # self._backend_connect(only_tracked=True) + if self._wizard_firstrun: self._finish_init() @@ -433,7 +443,9 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): there. """ if self._wizard is None: - self.disconnect_and_untrack() + # HACK FIX: disconnection of signals triggers a reconnection later + # chich segfaults on wizard quit + # self.disconnect_and_untrack() self._wizard = Wizard(backend=self._backend, leap_signaler=self._leap_signaler) self._wizard.accepted.connect(self._finish_init) @@ -764,7 +776,9 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self.eip_needs_login.emit() self._wizard = None - self._backend_connect(only_tracked=True) + # HACK FIX: disconnection of signals triggers a reconnection later + # chich segfaults on wizard quit + # self._backend_connect(only_tracked=True) else: domain = self._settings.get_provider() if domain is not None: diff --git a/src/leap/bitmask/gui/signaltracker.py b/src/leap/bitmask/gui/signaltracker.py index 4884334d..c83359c4 100644 --- a/src/leap/bitmask/gui/signaltracker.py +++ b/src/leap/bitmask/gui/signaltracker.py @@ -14,9 +14,12 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import logging from PySide import QtCore +logger = logging.getLogger(__name__) + class SignalTracker(QtCore.QObject): """ @@ -39,6 +42,10 @@ class SignalTracker(QtCore.QObject): :param method: the method to call when the signal is triggered. :type method: callable, Slot or Signal """ + if (signal, method) in self._connected_signals: + logger.warning("Signal already connected.") + return + self._connected_signals.append((signal, method)) signal.connect(method) @@ -49,7 +56,9 @@ class SignalTracker(QtCore.QObject): for signal, method in self._connected_signals: try: signal.disconnect(method) - except RuntimeError: - pass # Signal was not connected + except (TypeError, RuntimeError) as e: + # most likely the signal was not connected + logger.warning("Disconnect error: {0!r}".format(e)) + logger.warning("Signal: {0!r} -> {1!r}".format(signal, method)) self._connected_signals = [] diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index f1eab211..35043a68 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -152,7 +152,8 @@ class Wizard(QtGui.QWizard, SignalTracker): self._provider_setup_ok = False self.ui.lnProvider.setText('') self.ui.grpCheckProvider.setVisible(False) - self.disconnect_and_untrack() + # HACK FIX: disconnection of signals triggers a segfault on quit + # self.disconnect_and_untrack() def _load_configured_providers(self): """ |