diff --git a/LEGO1/mxdiskstreamprovider.cpp b/LEGO1/mxdiskstreamprovider.cpp index badc1623..b9ed63d0 100644 --- a/LEGO1/mxdiskstreamprovider.cpp +++ b/LEGO1/mxdiskstreamprovider.cpp @@ -40,10 +40,39 @@ MxDiskStreamProvider::MxDiskStreamProvider() this->m_unk0x35 = FALSE; } -// STUB: LEGO1 0x100d1240 +// FUNCTION: LEGO1 0x100d1240 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