diff src/gui/widgets/poster.cc @ 232:ff0061e75f0f

theme: add OS detection with glib
author Paper <mrpapersonic@gmail.com>
date Sat, 13 Jan 2024 11:06:16 -0500
parents 2f5a9247e501
children 4d461ef7d424
line wrap: on
line diff
--- a/src/gui/widgets/poster.cc	Sat Jan 13 09:43:41 2024 -0500
+++ b/src/gui/widgets/poster.cc	Sat Jan 13 11:06:16 2024 -0500
@@ -36,14 +36,15 @@
 
 void Poster::SetAnime(const Anime::Anime& anime) {
 	{
-		QByteArray ba;
+		QByteArray* ba = new QByteArray;
 
-		QThread* thread = QThread::create([&] {
-			ba = HTTP::Get(anime.GetPosterUrl(), {});
+		QThread* thread = QThread::create([ba, anime] {
+			*ba = HTTP::Get(anime.GetPosterUrl(), {});
 		});
 
-		connect(thread, &QThread::finished, this, [&] {
-			ImageDownloadFinished(ba);
+		connect(thread, &QThread::finished, this, [this, ba] {
+			ImageDownloadFinished(*ba);
+			delete ba;
 		});
 
 		thread->start();