Fix crash when trying to use automatically deleted ImageOverlay dialog

pull/1/head
Konstantinos Sideris 7 years ago
parent f95998a64b
commit 020f153f1f
  1. 1
      include/timeline/widgets/ImageItem.h
  2. 5
      src/timeline/widgets/ImageItem.cc

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

@ -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();
}
}

Loading…
Cancel
Save