src: Yearly copyright bump
[quassel.git] / src / test / util / invocationspy.cpp
index 74bb3bd..466b466 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2018 by the Quassel Project                        *
+ *   Copyright (C) 2005-2019 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -43,4 +43,16 @@ bool InvocationSpy::wait(std::chrono::milliseconds timeout)
     return result;
 }
 
+// -----------------------------------------------------------------------------------------------------------------------------------------
+
+bool SignalSpy::wait(std::chrono::milliseconds timeout)
+{
+    bool result = InvocationSpy::wait(timeout);
+    for (auto&& connection : _connections) {
+        QObject::disconnect(connection);
+    }
+    _connections.clear();
+    return result;
+}
+
 }  // namespace test