diff options
author | Tobias Markmann <tm@ayena.de> | 2013-01-17 16:11:43 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2013-01-27 22:11:12 (GMT) |
commit | 28c99a37d09a68ef993330b9ece2732ec03eba8f (patch) | |
tree | fa21b0d626055842ffcaee5d8fa5a1f7552cf38c /Swift/Controllers/ShowProfileController.cpp | |
parent | 17aaca4d226e48396437c512b6ea1873fc75b56c (diff) | |
download | swift-contrib-28c99a37d09a68ef993330b9ece2732ec03eba8f.zip swift-contrib-28c99a37d09a68ef993330b9ece2732ec03eba8f.tar.bz2 |
Fixing VCard related crash caused by wrong deletion of profile window.
Change-Id: Ifab6b304f0e25ab323b4a354f4682291e6aa1078
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/Controllers/ShowProfileController.cpp')
-rw-r--r-- | Swift/Controllers/ShowProfileController.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Swift/Controllers/ShowProfileController.cpp b/Swift/Controllers/ShowProfileController.cpp index ee0854b..15b7b26 100644 --- a/Swift/Controllers/ShowProfileController.cpp +++ b/Swift/Controllers/ShowProfileController.cpp @@ -25,7 +25,7 @@ ShowProfileController::ShowProfileController(VCardManager* vcardManager, Profile ShowProfileController::~ShowProfileController() { typedef std::pair<JID, ProfileWindow*> JIDProfileWindowPair; foreach(const JIDProfileWindowPair& jidWndPair, openedProfileWindows) { - jidWndPair.second->onWindowClosed.disconnect(boost::bind(&ShowProfileController::handleProfileWindowClosed, this, _1)); + jidWndPair.second->onWindowAboutToBeClosed.disconnect(boost::bind(&ShowProfileController::handleProfileWindowAboutToBeClosed, this, _1)); delete jidWndPair.second; } @@ -42,7 +42,7 @@ void ShowProfileController::handleUIEvent(UIEvent::ref event) { if (openedProfileWindows.find(showProfileEvent->getJID()) == openedProfileWindows.end()) { ProfileWindow* newProfileWindow = profileWindowFactory->createProfileWindow(); newProfileWindow->setJID(showProfileEvent->getJID()); - newProfileWindow->onWindowClosed.connect(boost::bind(&ShowProfileController::handleProfileWindowClosed, this, _1)); + newProfileWindow->onWindowAboutToBeClosed.connect(boost::bind(&ShowProfileController::handleProfileWindowAboutToBeClosed, this, _1)); openedProfileWindows[showProfileEvent->getJID()] = newProfileWindow; VCard::ref vcard = vcardManager->getVCardAndRequestWhenNeeded(showProfileEvent->getJID()); if (vcard) { @@ -67,10 +67,8 @@ void ShowProfileController::handleVCardChanged(const JID& jid, VCard::ref vcard) profileWindow->show(); } -void ShowProfileController::handleProfileWindowClosed(const JID& profileJid) { - ProfileWindow* profileWindow = openedProfileWindows[profileJid]; +void ShowProfileController::handleProfileWindowAboutToBeClosed(const JID& profileJid) { openedProfileWindows.erase(profileJid); - delete profileWindow; } } |