Ejemplo n.º 1
0
void
UninitColorMaps (void)
{
	int i;
	TFB_ColorMap *next;

	for (i = 0; i < MAX_COLORMAPS; ++i)
	{
		TFB_ColorMap *map = colormaps[i];
		if (!map)
			continue;
		release_colormap (map);
		colormaps[i] = 0;
	}

	// free spares
	for ( ; poolhead; poolhead = next, --poolcount)
	{
		next = poolhead->next;
		delete_colormap (poolhead);
	}

	DestroyMutex (fadeLock);
	// uninit xform control
	DestroyMutex (XFormControl.Lock);
	
	// uninit colormaps
	DestroyMutex (maplock);
}
Ejemplo n.º 2
0
void
mixSDL_Uninit (void)
{
	int i;

	UninitStreamDecoder ();

	for (i = 0; i < NUM_SOUNDSOURCES; ++i)
	{
		if (soundSource[i].sample && soundSource[i].sample->decoder)
		{
			StopStream (i);
		}
		if (soundSource[i].sbuffer)
		{
			void *sbuffer = soundSource[i].sbuffer;
			soundSource[i].sbuffer = NULL;
			HFree (sbuffer);
		}
		DestroyMutex (soundSource[i].stream_mutex);
		soundSource[i].stream_mutex = 0;

		mixSDL_DeleteSources (1, &soundSource[i].handle);
	}

	SDL_CloseAudio ();
	mixer_Uninit ();
	SoundDecoder_Uninit ();
	SDL_QuitSubSystem (SDL_INIT_AUDIO);
}
Ejemplo n.º 3
0
void 
TFB_DrawImage_Delete (TFB_Image *image)
{
	if (image == 0)
	{
		log_add (log_Warning, "INTERNAL ERROR: Tried to delete a null image!");
		/* Should we die here? */
		return;
	}
	LockMutex (image->mutex);

	TFB_DrawCanvas_Delete (image->NormalImg);
			
	if (image->ScaledImg)
	{
		TFB_DrawCanvas_Delete (image->ScaledImg);
		image->ScaledImg = 0;
	}

	if (image->FilledImg)
	{
		TFB_DrawCanvas_Delete (image->FilledImg);
		image->FilledImg = 0;
	}

	UnlockMutex (image->mutex);
	DestroyMutex (image->mutex);
			
	HFree (image);
}
void
openAL_Uninit (void)
{
	int i;

	UninitStreamDecoder ();

	for (i = 0; i < NUM_SOUNDSOURCES; ++i)
	{
		if (soundSource[i].sample && soundSource[i].sample->decoder)
		{
			StopStream (i);
		}
		if (soundSource[i].sbuffer)
		{
			void *sbuffer = soundSource[i].sbuffer;
			soundSource[i].sbuffer = NULL;
			HFree (sbuffer);
		}
		DestroyMutex (soundSource[i].stream_mutex);
	}

	alcMakeContextCurrent (NULL);
	alcDestroyContext (alcContext);
	alcContext = NULL;
	alcCloseDevice (alcDevice);
	alcDevice = NULL;

	SoundDecoder_Uninit ();
}
Ejemplo n.º 5
0
/* Uninitializer of NAT manager. */
static void nmUninitialize(__NAT_MANAGER* pMgr)
{
	__EASY_NAT_ENTRY* pEntry = NULL;

	BUG_ON(NULL == pMgr);
	BUG_ON(NULL == pMgr->pTree);
	BUG_ON(NULL == pMgr->lock);

	/* Destroy all NAT entries in system. */
	WaitForThisObject(pMgr->lock);
	pEntry = pMgr->entryList.pNext;
	while (pEntry != &pMgr->entryList)
	{
		/* Unlink it first. */
		pEntry->pNext->pPrev = pEntry->pPrev;
		pEntry->pPrev->pNext = pEntry->pNext;
		_hx_free(pEntry);
		pEntry = pMgr->entryList.pNext;
	}
	ReleaseMutex(pMgr->lock);

	/* Destroy lock. */
	DestroyMutex(pMgr->lock);

	/* Destroy the radix tree object. */
	DestroyRadixTree(pMgr->pTree);
	return;
}
Ejemplo n.º 6
0
PGPdiskMutex::~PGPdiskMutex()
{
	if (NULL!=(int)(mMutexHandle))
	{
		DestroyMutex(mMutexHandle);
		mMutexHandle = NULL;
	}
}
Ejemplo n.º 7
0
void
UninitColorMaps (void)
{
	TFB_ColorMap *next;

	// free spares
	for ( ; poolhead; poolhead = next)
	{
		next = poolhead->next;
		HFree (poolhead);
	}

	// uninit xform control
	DestroyMutex (XFormControl.Lock);
	
	// uninit colormaps
	DestroyMutex (maplock);
}
Ejemplo n.º 8
0
void 
CleanupTaskSystem (void)
{
	int i;
	for (i = 0; i < TASK_MAX; ++i)
	{
		DestroyMutex (task_array[i].state_mutex);
		task_array[i].state_mutex = 0;
	}
}
Ejemplo n.º 9
0
int
log_exit (int code)
{
    showBox = false;

    if (qlock)
    {
        qlock = 0;
        DestroyMutex (qmutex);
    }

    return code;
}
Ejemplo n.º 10
0
BOOLEAN
DestroyVideo (VIDEO_REF VideoRef)
{
	TFB_VideoClip* vid = (TFB_VideoClip*) VideoRef;

	if (!vid)
		return FALSE;

	VideoDecoder_Free (vid->decoder);
	DestroyMutex (vid->guard);
	HFree (vid);
	
	return TRUE;
}
Ejemplo n.º 11
0
void InodeCleanup()
{
	VxdDebugPrint(D_SYSTEM, "InoCleanUp");
	
	EnterMutex(sMutex, BLOCK_THREAD_IDLE);

	free(sInodeTable);

	LeaveMutex(sMutex);

	DestroyMutex(sMutex);

	VxdDebugPrint(D_SYSTEM, "InoCleanUp: done");
}
Ejemplo n.º 12
0
void
Callback_uninit(void) {
	// TODO: cleanup the queue?
	DestroyMutex (callbackListLock);
	callbackListLock = 0;
}
Ejemplo n.º 13
0
CWMutex::~CWMutex()
{
	DestroyMutex();
}