diff options
author | Remko Tronçon <git@el-tramo.be> | 2014-05-18 08:58:44 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2014-05-18 08:58:44 (GMT) |
commit | a507d029d8995e27adf96a46f60a8ba696667f7e (patch) | |
tree | a11c3d1f35b82ac40a7beb502de24af6c32e36d9 | |
parent | 13bcb579fe1ead0a5dca3defdef73023463c51e4 (diff) | |
download | swift-contrib-a507d029d8995e27adf96a46f60a8ba696667f7e.zip swift-contrib-a507d029d8995e27adf96a46f60a8ba696667f7e.tar.bz2 |
Fix MUC memory leaks
Change-Id: Icdd7f33012dec3fe7779ec4ad64df1c30d50ea77
-rw-r--r-- | Swiften/MUC/MUCImpl.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Swiften/MUC/MUCImpl.cpp b/Swiften/MUC/MUCImpl.cpp index 99789c0..a1854e3 100644 --- a/Swiften/MUC/MUCImpl.cpp +++ b/Swiften/MUC/MUCImpl.cpp @@ -240,5 +240,5 @@ void MUCImpl::handleIncomingPresence(Presence::ref presence) { presenceSender->addDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::DontSendPresence); mucPayload->setPayload(boost::make_shared<Form>(Form::SubmitType)); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr< GenericRequest<MUCOwnerPayload> > request = boost::make_shared< GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleCreationConfigResponse, this, _1, _2)); request->send(); @@ -286,5 +286,5 @@ void MUCImpl::changeOccupantRole(const JID& jid, MUCOccupant::Role role) { item.nick = jid.getResource(); mucPayload->addItem(item); - GenericRequest<MUCAdminPayload>* request = new GenericRequest<MUCAdminPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCAdminPayload> > request = boost::make_shared<GenericRequest<MUCAdminPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleOccupantRoleChangeResponse, this, _1, _2, jid, role)); request->send(); @@ -303,5 +303,5 @@ void MUCImpl::requestAffiliationList(MUCOccupant::Affiliation affiliation) { item.affiliation = affiliation; mucPayload->addItem(item); - GenericRequest<MUCAdminPayload>* request = new GenericRequest<MUCAdminPayload>(IQ::Get, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCAdminPayload> > request = boost::make_shared< GenericRequest<MUCAdminPayload> >(IQ::Get, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleAffiliationListResponse, this, _1, _2, affiliation)); request->send(); @@ -317,5 +317,5 @@ void MUCImpl::changeAffiliation(const JID& jid, MUCOccupant::Affiliation affilia item.realJID = jid.toBare(); mucPayload->addItem(item); - GenericRequest<MUCAdminPayload>* request = new GenericRequest<MUCAdminPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCAdminPayload> > request = boost::make_shared<GenericRequest<MUCAdminPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleAffiliationChangeResponse, this, _1, _2, jid, affiliation)); request->send(); @@ -353,5 +353,5 @@ void MUCImpl::changeSubject(const std::string& subject) { void MUCImpl::requestConfigurationForm() { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Get, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Get, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleConfigurationFormReceived, this, _1, _2)); request->send(); @@ -361,5 +361,5 @@ void MUCImpl::cancelConfigureRoom() { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); mucPayload->setPayload(boost::make_shared<Form>(Form::CancelType)); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->send(); } @@ -386,5 +386,5 @@ void MUCImpl::configureRoom(Form::ref form) { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); mucPayload->setPayload(form); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); if (unlocking) { request->onResponse.connect(boost::bind(&MUCImpl::handleCreationConfigResponse, this, _1, _2)); @@ -400,5 +400,5 @@ void MUCImpl::destroyRoom() { MUCDestroyPayload::ref mucDestroyPayload = boost::make_shared<MUCDestroyPayload>(); mucPayload->setPayload(mucDestroyPayload); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr< GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleConfigurationResultReceived, this, _1, _2)); request->send(); |