mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix printing race conditions
This commit is contained in:
parent
8d9d644dfe
commit
66ce1063d4
|
@ -640,6 +640,7 @@ void CoreController::attachPrinter() {
|
||||||
}
|
}
|
||||||
QMetaObject::invokeMethod(qPrinter->parent, "imagePrinted", Q_ARG(const QImage&, image));
|
QMetaObject::invokeMethod(qPrinter->parent, "imagePrinted", Q_ARG(const QImage&, image));
|
||||||
};
|
};
|
||||||
|
Interrupter interrupter(this);
|
||||||
GBSIOSetDriver(&gb->sio, &m_printer.d.d);
|
GBSIOSetDriver(&gb->sio, &m_printer.d.d);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -649,6 +650,7 @@ void CoreController::detachPrinter() {
|
||||||
if (platform() != PLATFORM_GB) {
|
if (platform() != PLATFORM_GB) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Interrupter interrupter(this);
|
||||||
GB* gb = static_cast<GB*>(m_threadContext.core->board);
|
GB* gb = static_cast<GB*>(m_threadContext.core->board);
|
||||||
GBPrinterDonePrinting(&m_printer.d);
|
GBPrinterDonePrinting(&m_printer.d);
|
||||||
GBSIOSetDriver(&gb->sio, nullptr);
|
GBSIOSetDriver(&gb->sio, nullptr);
|
||||||
|
@ -660,6 +662,7 @@ void CoreController::endPrint() {
|
||||||
if (platform() != PLATFORM_GB) {
|
if (platform() != PLATFORM_GB) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Interrupter interrupter(this);
|
||||||
GBPrinterDonePrinting(&m_printer.d);
|
GBPrinterDonePrinting(&m_printer.d);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue