diff options
author | Joanna Hulboj <joanna.hulboj@isode.com> | 2017-11-21 15:55:35 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2017-11-22 14:53:54 (GMT) |
commit | ff39e92d8b42fbf20eeeab56b0599d5e3db79a21 (patch) | |
tree | e93e734808d3eda0c17e47571600ef5fe3302e3d /Swift | |
parent | e349af199711dc9d98ea27834daeeb0e7b461e6a (diff) | |
download | swift-ff39e92d8b42fbf20eeeab56b0599d5e3db79a21.zip swift-ff39e92d8b42fbf20eeeab56b0599d5e3db79a21.tar.bz2 |
Fix Emoji crash on insertion
Swift would crash randomly when user clicked to insert an Emoji. It was
happening because we would delete the emojisGrid_ while it was still in
use (was closing).
Test-Information:
Tested on Windows 10 and Ubuntu 16.04.
Tested by inserting an Emoji from the Emoji selector. This action does not result in
crash any more.
Change-Id: I6c0b84ea8969c7f7a4c3bfa700e345cdf63325e6
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index 7051683..874f710 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -707,9 +707,9 @@ void QtChatWindow::handleEmojiClicked(QString emoji) { if (isVisible()) { input_->textCursor().insertText(emoji); input_->setFocus(); - // The next line also deletes the emojisGrid_, as it was added to the - // layout of the emojisMenu_. - emojisMenu_.reset(); + // We cannot delete the emojisGrid_ + // Grid may not close yet and we should not try to destroy it. + emojisMenu_->setVisible(false); } } |