Implement/match MxDiskStreamProvider destructor (#381)

This commit is contained in:
Christian Semmler 2023-12-28 11:46:12 -05:00 committed by GitHub
parent e3488498f9
commit e17e8ed5ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,10 +40,39 @@ MxDiskStreamProvider::MxDiskStreamProvider()
this->m_unk0x35 = FALSE; this->m_unk0x35 = FALSE;
} }
// STUB: LEGO1 0x100d1240 // FUNCTION: LEGO1 0x100d1240
MxDiskStreamProvider::~MxDiskStreamProvider() MxDiskStreamProvider::~MxDiskStreamProvider()
{ {
// TODO MxDSStreamingAction* action;
m_unk0x35 = FALSE;
do {
action = NULL;
{
MxAutoLocker lock(&m_criticalSection);
m_list.PopFrontStreamingAction(action);
}
if (!action)
break;
if (action->GetUnknowna0()->GetWriteOffset() < 0x20000)
g_unk0x10102878--;
((MxDiskStreamController*) m_pLookup)->FUN_100c8670(action);
} while (action);
if (m_remainingWork) {
m_remainingWork = FALSE;
m_busySemaphore.Release(1);
m_thread.Terminate();
}
if (m_pFile)
delete m_pFile;
m_pFile = NULL;
} }
// FUNCTION: LEGO1 0x100d13d0 // FUNCTION: LEGO1 0x100d13d0