mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Fix huge memleak in server code caused by thread pingpong fix.
Stopped QThreads don't process events, so cleanup signals get lost. Prevent this from happening by keeping the threads alive and the comic inside the thread (as we already do in the viewer). Cleanup happens by connecting the comic's destroyed() signal to the thread's quit() slot.
This commit is contained in:
committed by
Luis Ángel San Martín
parent
cc71f419cc
commit
be547081f2
@ -57,9 +57,10 @@ void ComicController::service(HttpRequest &request, HttpResponse &response)
|
||||
|
||||
comicFile->moveToThread(thread);
|
||||
|
||||
connect(comicFile, SIGNAL(errorOpening()), thread, SLOT(quit()));
|
||||
connect(comicFile, SIGNAL(errorOpening(QString)), thread, SLOT(quit()));
|
||||
connect(comicFile, SIGNAL(imagesLoaded()), thread, SLOT(quit()));
|
||||
//connect(comicFile, SIGNAL(errorOpening()), thread, SLOT(quit()));
|
||||
//connect(comicFile, SIGNAL(errorOpening(QString)), thread, SLOT(quit()));
|
||||
//connect(comicFile, SIGNAL(imagesLoaded()), thread, SLOT(quit()));
|
||||
connect(comicFile, SIGNAL(destroyed()), thread, SLOT(quit()));
|
||||
connect(thread, SIGNAL(started()), comicFile, SLOT(process()));
|
||||
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
|
||||
|
||||
|
Reference in New Issue
Block a user