Explicitly call VertexBufferManager cleanup code, since we can't rely on

the order of destructors called for global instances.

This was SVN commit r2846.
This commit is contained in:
prefect 2005-10-04 20:54:47 +00:00
parent a181ef1fef
commit a4fc7105be
3 changed files with 12 additions and 0 deletions

View File

@ -728,6 +728,7 @@ void Shutdown()
// destroy renderer
TIMER_START("shutdown Renderer");
delete &g_Renderer;
g_VBMan.Shutdown();
TIMER_END("shutdown Renderer");
TIMER_START("shutdown ConfigDB");

View File

@ -18,6 +18,14 @@ CVertexBufferManager g_VBMan;
// janwas 2004-06-14: added dtor
CVertexBufferManager::~CVertexBufferManager()
{
}
///////////////////////////////////////////////////////////////////////////////
// Explicit shutdown of the vertex buffer subsystem.
// This avoids the ordering issues that arise when using destructors of
// global instances.
void CVertexBufferManager::Shutdown()
{
debug_printf("CVertexBufferManager shutdown\n");

View File

@ -20,6 +20,9 @@ public:
CVertexBufferManager() {}
~CVertexBufferManager();
// Explicit shutdown of the vertex buffer subsystem
void Shutdown();
// try to allocate a buffer of given number of vertices (each of given size),
// and with the given type - return null if no free chunks available
CVertexBuffer::VBChunk* Allocate(size_t vertexSize,size_t numVertices,bool dynamic);