ALvoid alDeleteStream( ALvoid ) { assert(s_pState->m_Stream.m_Valid); // stop the audio alStreamStop(); // kill the thread QALState::StreamInfo::Request req; req.m_Type = QALState::StreamInfo::REQ_SHUTDOWN; _postStreamRequest(req); // Wait for thread to close WaitForSingleObject(s_pState->m_Stream.m_Thread, INFINITE); // thread handles CloseHandle(s_pState->m_Stream.m_Thread); CloseHandle(s_pState->m_Stream.m_Mutex); CloseHandle(s_pState->m_Stream.m_QueueLen); // release the stream s_pState->m_Stream.m_pVoice->Release(); XPhysicalFree(s_pState->m_Stream.m_pPacketBuffer); s_pState->m_Stream.m_Valid = false; }
ResourceDatabase::~ResourceDatabase() { m_pDefaultTexture2D = NULL; m_pDefaultTextureCube = NULL; { std::list<VOID*>::iterator iter = m_PhysicalAllocations.begin(); std::list<VOID*>::iterator end = m_PhysicalAllocations.end(); while( iter != end ) { XPhysicalFree( *iter ); ++iter; } m_PhysicalAllocations.clear(); iter = m_VirtualAllocations.begin(); end = m_VirtualAllocations.end(); while( iter != end ) { delete[] *iter; ++iter; } m_VirtualAllocations.clear(); } { std::list<PackedResource*>::iterator iter = m_BundledResources.begin(); std::list<PackedResource*>::iterator end = m_BundledResources.end(); while( iter != end ) { delete *iter; ++iter; } m_BundledResources.clear(); } { NameIndexedCollection::iterator iter = m_Resources.begin(); NameIndexedCollection::iterator end = m_Resources.end(); while( iter != end ) { Resource* pResource = (Resource*)*iter; if( pResource->bFromPackedResource == FALSE ) { delete pResource; } iter++; } } }
//-------------------------------------------------------------------------------------- // Name: ~Mesh2() // Desc: Destructor //-------------------------------------------------------------------------------------- Mesh2::~Mesh2() { delete[] m_pAllocatedSysMem; if( m_pAllocatedVidMem ) XPhysicalFree( m_pAllocatedVidMem ); }