From 244252f61052f3555a90fa01f6b1e87d1e667689 Mon Sep 17 00:00:00 2001 From: rexim Date: Wed, 12 Jun 2019 02:04:57 +0700 Subject: [PATCH] (#976) Make TooltipPreviewImage non-copyable --- src/singletons/TooltipPreviewImage.hpp | 2 ++ src/widgets/helper/ChannelView.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/singletons/TooltipPreviewImage.hpp b/src/singletons/TooltipPreviewImage.hpp index 1d2474e04..a56a37888 100644 --- a/src/singletons/TooltipPreviewImage.hpp +++ b/src/singletons/TooltipPreviewImage.hpp @@ -8,6 +8,8 @@ namespace chatterino { static TooltipPreviewImage &getInstance(); void setImage(ImagePtr image); + TooltipPreviewImage(const TooltipPreviewImage&) = delete; + private: TooltipPreviewImage(); diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 0304ec5bb..9af6a8ca5 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1219,7 +1219,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event) } else { - auto tooltipPreviewImage = TooltipPreviewImage::getInstance(); + auto &tooltipPreviewImage = TooltipPreviewImage::getInstance(); auto emoteElement = dynamic_cast(&hoverLayoutElement->getCreator()); if (emoteElement && getSettings()->emotesTooltipPreview.getValue()) { tooltipPreviewImage.setImage(emoteElement->getEmote()->images.getImage(3.0));