diff options
author | Tobias Markmann <tm@ayena.de> | 2015-02-08 15:40:50 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2015-02-09 15:36:19 (GMT) |
commit | 1c64e31945e80e927f87a0a94ec5ce0e00c40a7f (patch) | |
tree | 80f00a3d133ec27945445728ec312c5900c0f975 /Swiften | |
parent | ef319397be8439482fdf95f46a29643d15980b37 (diff) | |
download | swift-1c64e31945e80e927f87a0a94ec5ce0e00c40a7f.zip swift-1c64e31945e80e927f87a0a94ec5ce0e00c40a7f.tar.bz2 |
Fix memory leaks reported by LSAN
Qt models are not owned by their widgets. They must be deleted manually
or a parent has to be specified for them which will take care of deletion.
The same goes for delegates and their views.
Test-Information:
Tested with Clang's leak sanitizer (part of address sanitizer). The
leak reports for the respective lines are gone with this fix.
Change-Id: Ia7407cb20ae9e4ccc2e1cf48c88877c2f87352e1
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/Client/Client.cpp | 4 | ||||
-rw-r--r-- | Swiften/FileTransfer/FileTransferManagerImpl.cpp | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp index 323bb43..d2f8b7a 100644 --- a/Swiften/Client/Client.cpp +++ b/Swiften/Client/Client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2012 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -86,6 +86,7 @@ Client::~Client() { delete whiteboardSessionManager; delete fileTransferManager; + delete blockListManager; delete jingleSessionManager; delete blindCertificateTrustChecker; @@ -125,6 +126,7 @@ void Client::setSoftwareVersion(const std::string& name, const std::string& vers } void Client::handleConnected() { + delete fileTransferManager; #ifdef SWIFT_EXPERIMENTAL_FT fileTransferManager = new FileTransferManagerImpl( getJID(), diff --git a/Swiften/FileTransfer/FileTransferManagerImpl.cpp b/Swiften/FileTransfer/FileTransferManagerImpl.cpp index fe8bfd6..f439197 100644 --- a/Swiften/FileTransfer/FileTransferManagerImpl.cpp +++ b/Swiften/FileTransfer/FileTransferManagerImpl.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2013-2014 Isode Limited. + * Copyright (c) 2013-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -86,10 +86,12 @@ FileTransferManagerImpl::FileTransferManagerImpl( } FileTransferManagerImpl::~FileTransferManagerImpl() { - delete s5bServerManager; delete incomingFTManager; delete outgoingFTManager; delete transporterFactory; + delete bytestreamProxy; + delete s5bServerManager; + delete bytestreamRegistry; } void FileTransferManagerImpl::start() { |