diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-06-03 17:09:04 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-06-03 17:09:04 (GMT) |
commit | bc41379bdb1ea19757914f45743ed97c999ce9e1 (patch) | |
tree | 68b365c719e5f9d36ad927ad04147d1a7e208982 /Swiften/Queries | |
parent | b9c67ff5f22fd434f47eeb5de67c1fc70ce3274f (diff) | |
download | swift-bc41379bdb1ea19757914f45743ed97c999ce9e1.zip swift-bc41379bdb1ea19757914f45743ed97c999ce9e1.tar.bz2 |
Fix memory leak when receiving an error response on a request.
Diffstat (limited to 'Swiften/Queries')
-rw-r--r-- | Swiften/Queries/Request.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Swiften/Queries/Request.cpp b/Swiften/Queries/Request.cpp index ac361cc..609d67b 100644 --- a/Swiften/Queries/Request.cpp +++ b/Swiften/Queries/Request.cpp @@ -17,23 +17,21 @@ void Request::send() { } bool Request::handleIQ(boost::shared_ptr<IQ> iq) { + bool handled = false; if (iq->getID() == id_) { if (iq->getType() == IQ::Result) { handleResponse(iq->getPayloadOfSameType(payload_), boost::optional<Error>()); - if (autoDeleteBehavior_ == AutoDeleteAfterResponse) { - MainEventLoop::deleteLater(this); - } - return true; } else { // FIXME: Get proper error handleResponse(boost::shared_ptr<Payload>(), boost::optional<Error>(Error::UndefinedCondition)); - return true; } + if (autoDeleteBehavior_ == AutoDeleteAfterResponse) { + MainEventLoop::deleteLater(this); + } + handled = true; } - else { - return false; - } + return handled; } } |