remove global emuThread from Window.cpp

This commit is contained in:
Arisotura
2024-02-20 13:29:21 +01:00
parent a7a7ac53c1
commit 6a2039aee1
3 changed files with 12 additions and 1 deletions

View File

@ -96,6 +96,7 @@ EmuThread::EmuThread(QObject* parent) : QThread(parent)
void EmuThread::attachWindow(MainWindow* window)
{
windowList.push_back(window);
window->attachEmuThread(this);
mainWindow = windowList.front();
connect(this, SIGNAL(windowUpdate()), window->panel, SLOT(repaint()));
@ -128,6 +129,7 @@ void EmuThread::detachWindow(MainWindow* window)
disconnect(this, SIGNAL(screenEmphasisToggle()), window, SLOT(onScreenEmphasisToggled()));
windowList.remove(window);
window->attachEmuThread(nullptr);
mainWindow = windowList.front();
}