Periodically free memory from unused images (#3915)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Daniel Sage
2022-09-04 07:23:14 -04:00
committed by GitHub
parent bc38d696bc
commit 8ec032fc84
7 changed files with 246 additions and 35 deletions
@@ -344,17 +344,17 @@ MessagePtr TwitchMessageBuilder::build()
if (this->thread_)
{
auto &img = getResources().buttons.replyThreadDark;
this->emplace<CircularImageElement>(Image::fromPixmap(img, 0.15), 2,
Qt::gray,
MessageElementFlag::ReplyButton)
this->emplace<CircularImageElement>(
Image::fromResourcePixmap(img, 0.15), 2, Qt::gray,
MessageElementFlag::ReplyButton)
->setLink({Link::ViewThread, this->thread_->rootId()});
}
else
{
auto &img = getResources().buttons.replyDark;
this->emplace<CircularImageElement>(Image::fromPixmap(img, 0.15), 2,
Qt::gray,
MessageElementFlag::ReplyButton)
this->emplace<CircularImageElement>(
Image::fromResourcePixmap(img, 0.15), 2, Qt::gray,
MessageElementFlag::ReplyButton)
->setLink({Link::ReplyToMessage, this->message().id});
}