summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/signaltracker.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-12-30 19:53:14 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-12-30 20:04:03 -0300
commit34bdb47251b93bcfc767aec341490386a08ba4a6 (patch)
tree3ab25d34cf388f40caac2459179caaf72494322c /src/leap/bitmask/gui/signaltracker.py
parentf60b7d52e2938a48ad0a79b620274c531ca252a6 (diff)
Disable signal disconnection and untrack.0.8.0rc1
This temporary hack prevents the app to have segfaults when the first run wizard finishes. For more information look at https://leap.se/code/issues/6597
Diffstat (limited to 'src/leap/bitmask/gui/signaltracker.py')
-rw-r--r--src/leap/bitmask/gui/signaltracker.py13
1 files changed, 11 insertions, 2 deletions
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 = []