mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Render: Protect against race condition in setNumPages (#220)
* Render: Use sendPostedEvents to force processing of queued events when removing old comic objects
This commit is contained in:
parent
64f7e63a2a
commit
e5526de0af
@ -695,13 +695,12 @@ void Render::createComic(const QString &path)
|
||||
pagesEmited.clear();
|
||||
|
||||
if (comic != nullptr) {
|
||||
//comic->moveToThread(QApplication::instance()->thread());
|
||||
comic->invalidate();
|
||||
|
||||
comic->disconnect();
|
||||
// Dispatch pending events to guard against race conditons
|
||||
QCoreApplication::sendPostedEvents(this);
|
||||
comic->deleteLater();
|
||||
}
|
||||
//comic->moveToThread(QApplication::instance()->thread());
|
||||
comic = FactoryComic::newComic(path);
|
||||
|
||||
if (comic == nullptr) //archivo no encontrado o no válido
|
||||
|
Loading…
x
Reference in New Issue
Block a user