mirror of
https://github.com/YACReader/yacreader
synced 2025-08-02 04:15:35 -04:00
Fixed thread leak when a comic has to be destroyed while it is being processed.
This commit is contained in:
@ -761,6 +761,8 @@ void Render::createComic(const QString & path)
|
||||
if(comic!=0)
|
||||
{
|
||||
//comic->moveToThread(QApplication::instance()->thread());
|
||||
comic->invalidate();
|
||||
|
||||
comic->disconnect();
|
||||
comic->deleteLater();
|
||||
}
|
||||
@ -817,6 +819,7 @@ void Render::startLoad()
|
||||
connect(comic, SIGNAL(errorOpening(QString)), thread, SLOT(quit()), Qt::QueuedConnection);
|
||||
connect(comic, SIGNAL(imagesLoaded()), thread, SLOT(quit()), Qt::QueuedConnection);
|
||||
connect(comic, SIGNAL(destroyed()), thread, SLOT(quit()), Qt::QueuedConnection);
|
||||
connect(comic, SIGNAL(invalidated()), thread, SLOT(quit()), Qt::QueuedConnection);
|
||||
connect(thread, SIGNAL(started()), comic, SLOT(process()));
|
||||
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
|
||||
|
||||
|
Reference in New Issue
Block a user