Fix crash when trying to use automatically deleted ImageOverlay dialog
This commit is contained in:
parent
f95998a64b
commit
020f153f1f
@ -79,5 +79,4 @@ private:
|
|||||||
mtx::events::RoomEvent<mtx::events::msg::Image> event_;
|
mtx::events::RoomEvent<mtx::events::msg::Image> event_;
|
||||||
|
|
||||||
QSharedPointer<MatrixClient> client_;
|
QSharedPointer<MatrixClient> client_;
|
||||||
QSharedPointer<dialogs::ImageOverlay> image_dialog_;
|
|
||||||
};
|
};
|
||||||
|
@ -150,9 +150,8 @@ ImageItem::mousePressEvent(QMouseEvent *event)
|
|||||||
if (textRegion_.contains(event->pos())) {
|
if (textRegion_.contains(event->pos())) {
|
||||||
openUrl();
|
openUrl();
|
||||||
} else {
|
} else {
|
||||||
image_dialog_ =
|
auto imgDialog = new dialogs::ImageOverlay(image_);
|
||||||
QSharedPointer<dialogs::ImageOverlay>(new dialogs::ImageOverlay(image_, this));
|
imgDialog->show();
|
||||||
image_dialog_->show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user