void ShutdownHavok() {   
	g_pWorld->markForWrite();
	for(int i=0;i<MAX_BOXES;++i) {
		boxes[i]->removeReference();
	}
	g_pWorld->unmarkForWrite();

	if(g_pWorld)
	{ 
		g_pWorld->markForWrite();		
		g_pWorld->removeReference();
		g_pWorld = HK_NULL;
	}	
	delete g_pJobQueue;

	// Clean up the thread pool
	g_pThreadPool->removeReference();
	
	if (g_bVdbEnabled)
		ShutdownVDB();
		 
	boxes.clear(); 
	 
	hkBaseSystem::quit();
    hkMemoryInitUtil::quit();
}