From 020f153f1fed09c1cbeb5393098198c3f4bd49df Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Tue, 20 Feb 2018 22:08:16 +0200 Subject: [PATCH] Fix crash when trying to use automatically deleted ImageOverlay dialog --- include/timeline/widgets/ImageItem.h | 1 - src/timeline/widgets/ImageItem.cc | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/timeline/widgets/ImageItem.h b/include/timeline/widgets/ImageItem.h index 21d91b52..a95104fb 100644 --- a/include/timeline/widgets/ImageItem.h +++ b/include/timeline/widgets/ImageItem.h @@ -79,5 +79,4 @@ private: mtx::events::RoomEvent event_; QSharedPointer client_; - QSharedPointer image_dialog_; }; diff --git a/src/timeline/widgets/ImageItem.cc b/src/timeline/widgets/ImageItem.cc index 08a057da..83ab96b1 100644 --- a/src/timeline/widgets/ImageItem.cc +++ b/src/timeline/widgets/ImageItem.cc @@ -150,9 +150,8 @@ ImageItem::mousePressEvent(QMouseEvent *event) if (textRegion_.contains(event->pos())) { openUrl(); } else { - image_dialog_ = - QSharedPointer(new dialogs::ImageOverlay(image_, this)); - image_dialog_->show(); + auto imgDialog = new dialogs::ImageOverlay(image_); + imgDialog->show(); } }