summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-07-21 16:30:15 (GMT)
committerTobias Markmann <tm@ayena.de>2015-07-21 16:42:34 (GMT)
commit6ca201d0b48f4273e24dd7bff17c4a46eeaddf39 (patch)
treeace238716521c89a54168472905379a9249c3666 /Swiften/Client/ClientSessionStanzaChannel.h
parent02ecf91d261276ec6f1e46b537ac0e10ebae3170 (diff)
downloadswift-6ca201d0b48f4273e24dd7bff17c4a46eeaddf39.zip
swift-6ca201d0b48f4273e24dd7bff17c4a46eeaddf39.tar.bz2
Explicitly disconnect from remaining resources in destructors
Explicitly disconnect from remaining resources in the ChainedConnected and ClientSessionStanzaChannel destructors, so the event loop will not call the signal handler methods on a freed object. Test-Information: Repeating the test case of creating a Swift::Client instance, connecting it and then deleting it after a random time below one second. On Mac OS X 10.9.5 running this test case causes two ASAN heap-use-after-free errors and with this patch the errors are gone. Change-Id: I3e48150c3633f4076ca9172aad9e85ba389df950
Diffstat (limited to 'Swiften/Client/ClientSessionStanzaChannel.h')
-rw-r--r--Swiften/Client/ClientSessionStanzaChannel.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Swiften/Client/ClientSessionStanzaChannel.h b/Swiften/Client/ClientSessionStanzaChannel.h
index 1104416..0ffcd9d 100644
--- a/Swiften/Client/ClientSessionStanzaChannel.h
+++ b/Swiften/Client/ClientSessionStanzaChannel.h
@@ -12,8 +12,8 @@
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/Client/ClientSession.h>
#include <Swiften/Client/StanzaChannel.h>
-#include <Swiften/Elements/Message.h>
#include <Swiften/Elements/IQ.h>
+#include <Swiften/Elements/Message.h>
#include <Swiften/Elements/Presence.h>
namespace Swift {
@@ -22,6 +22,8 @@ namespace Swift {
*/
class SWIFTEN_API ClientSessionStanzaChannel : public StanzaChannel {
public:
+ virtual ~ClientSessionStanzaChannel();
+
void setSession(boost::shared_ptr<ClientSession> session);
void sendIQ(boost::shared_ptr<IQ> iq);