diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-10-07 20:09:34 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-10-07 20:51:35 +0300 |
commit | bc4b47a5e30386df46f5d4d51a5be33b6a9d4c2f (patch) | |
tree | 42bd697afd1b4ce3d7b88bfefe11aa71dbdafae7 /src/EmojiPickButton.cc | |
parent | Update from Weblate. (#38) (diff) | |
download | nheko-bc4b47a5e30386df46f5d4d51a5be33b6a9d4c2f.tar.xz |
Use shared pointer for the modals
Diffstat (limited to 'src/EmojiPickButton.cc')
-rw-r--r-- | src/EmojiPickButton.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/EmojiPickButton.cc b/src/EmojiPickButton.cc index f3e30661..4f7dd59e 100644 --- a/src/EmojiPickButton.cc +++ b/src/EmojiPickButton.cc @@ -30,9 +30,10 @@ EmojiPickButton::enterEvent(QEvent *e) { Q_UNUSED(e); - if (panel_ == nullptr) { - panel_ = new EmojiPanel(this); - connect(panel_, &EmojiPanel::emojiSelected, this, &EmojiPickButton::emojiSelected); + if (panel_.isNull()) { + panel_ = QSharedPointer<EmojiPanel>(new EmojiPanel(this)); + connect( + panel_.data(), &EmojiPanel::emojiSelected, this, &EmojiPickButton::emojiSelected); } QPoint pos(rect().x(), rect().y()); |