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/ProfileController.cpp | |
parent | 17aaca4d226e48396437c512b6ea1873fc75b56c (diff) | |
download | swift-28c99a37d09a68ef993330b9ece2732ec03eba8f.zip swift-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/ProfileController.cpp')
-rw-r--r-- | Swift/Controllers/ProfileController.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Swift/Controllers/ProfileController.cpp b/Swift/Controllers/ProfileController.cpp index e641988..241cc2e 100644 --- a/Swift/Controllers/ProfileController.cpp +++ b/Swift/Controllers/ProfileController.cpp @@ -25,7 +25,7 @@ ProfileController::~ProfileController() { if (profileWindow) { vcardManager->onOwnVCardChanged.disconnect(boost::bind(&ProfileController::handleOwnVCardChanged, this, _1)); profileWindow->onVCardChangeRequest.disconnect(boost::bind(&ProfileController::handleVCardChangeRequest, this, _1)); - delete profileWindow; + profileWindow->onWindowAboutToBeClosed.disconnect(boost::bind(&ProfileController::handleProfileWindowAboutToBeClosed, this, _1)); } uiEventStream->onUIEvent.disconnect(boost::bind(&ProfileController::handleUIEvent, this, _1)); } @@ -39,6 +39,7 @@ void ProfileController::handleUIEvent(UIEvent::ref event) { profileWindow = profileWindowFactory->createProfileWindow(); profileWindow->setEditable(true); profileWindow->onVCardChangeRequest.connect(boost::bind(&ProfileController::handleVCardChangeRequest, this, _1)); + profileWindow->onWindowAboutToBeClosed.connect(boost::bind(&ProfileController::handleProfileWindowAboutToBeClosed, this, _1)); vcardManager->onOwnVCardChanged.connect(boost::bind(&ProfileController::handleOwnVCardChanged, this, _1)); } gettingVCard = true; @@ -76,6 +77,10 @@ void ProfileController::handleOwnVCardChanged(VCard::ref vcard) { } } +void ProfileController::handleProfileWindowAboutToBeClosed(const JID&) { + profileWindow = NULL; +} + void ProfileController::setAvailable(bool b) { available = b; if (!available) { |