Exemplo n.º 1
0
//////////////////////////////////////////////////////////////////////////
// processUnloadingResources
void CsCore::processUnloadingResources()
{
	std::lock_guard< std::recursive_mutex > Lock( ContainerLock_ );

	while( UnloadingResources_.size() > 0 )
	{
		TResourceList ResourceList = UnloadingResources_;

		TResourceListIterator It( ResourceList.begin() );
		while( It != ResourceList.end() )
		{
			CsResource* pResource = (*It);
			
			// Destroy resource.
			pResource->destroy();
			
			// Free resource.
			pResource->getClass()->destruct( pResource );
			BcMemFree( pResource );
			
			// Next.
			++It;
		}
	
		UnloadingResources_.clear();
	}
}
Exemplo n.º 2
0
//////////////////////////////////////////////////////////////////////////
// processUnloadingResources
void CsCore::processUnloadingResources()
{
	BcScopedLock< BcMutex > Lock( ContainerLock_ );

	TResourceListIterator It( UnloadingResources_.begin() );
	while( It != UnloadingResources_.end() )
	{
		CsResource* pResource = (*It);
		
		// Destroy resource.
		pResource->destroy();
		
		// Free resource.
		delete pResource;
		
		// Remove from list.
		It = UnloadingResources_.erase( It );
	}
}