Fix crash when trying to use automatically deleted ImageOverlay dialog

This commit is contained in:
Konstantinos Sideris 2018-02-20 22:08:16 +02:00
parent f95998a64b
commit 020f153f1f
2 changed files with 2 additions and 4 deletions

View file

@ -79,5 +79,4 @@ private:
mtx::events::RoomEvent<mtx::events::msg::Image> event_;
QSharedPointer<MatrixClient> client_;
QSharedPointer<dialogs::ImageOverlay> image_dialog_;
};

View file

@ -150,9 +150,8 @@ ImageItem::mousePressEvent(QMouseEvent *event)
if (textRegion_.contains(event->pos())) {
openUrl();
} else {
image_dialog_ =
QSharedPointer<dialogs::ImageOverlay>(new dialogs::ImageOverlay(image_, this));
image_dialog_->show();
auto imgDialog = new dialogs::ImageOverlay(image_);
imgDialog->show();
}
}