fix some crashes, mostly related to network requests (#6187)

This commit is contained in:
pajlada
2025-05-17 14:22:56 +02:00
committed by GitHub
parent 46f3299a25
commit 6b968a199c
17 changed files with 259 additions and 81 deletions
+11
View File
@@ -282,6 +282,15 @@ Image::~Image()
return;
}
if (isAppAboutToQuit())
{
if (this->frames_)
{
std::ignore = this->frames_.release();
}
return;
}
// Ensure the destructor for our frames is called in the GUI thread
// If the Image destructor is called outside of the GUI thread, move the
// ownership of the frames to the GUI thread, otherwise the frames will be
@@ -488,6 +497,8 @@ void Image::actuallyLoad()
return;
}
assert(!isAppAboutToQuit());
QBuffer buffer;
buffer.setData(result.getData());
QImageReader reader(&buffer);