Esempio n. 1
0
GLCLDraw::~GLCLDraw()
{
   cl_int ret;
   int i;
   if(nkernels > 0) {
     for(i = 0; i < nkernels; i++) if(kernels_array[i] != NULL) ret = clReleaseKernel(kernels_array[i]);
   }
   
   if(program_8 != NULL) ret |= clReleaseProgram(program_8);
   if(program_4096 != NULL) ret |= clReleaseProgram(program_4096);
   if(program_256k != NULL) ret |= clReleaseProgram(program_256k);
   if(program_copyvram != NULL) ret |= clReleaseProgram(program_copyvram);
   if(program_tables != NULL) ret |= clReleaseProgram(program_tables);
   if(command_queue != NULL) ret |= clReleaseCommandQueue(command_queue);
   if(context != NULL) ret |= clReleaseContext(context);
   if(properties != NULL) free(properties);
   for(i = 0; i < 2; i++) {
      if(inbuf[i] != NULL) ret |= clReleaseMemObject(inbuf[i]);
      if(palette_buf[i] != NULL) ret |= clReleaseMemObject(palette_buf[i]);
   }
   if(outbuf != NULL) ret |= clReleaseMemObject(outbuf);
   if(table != NULL) ret |= clReleaseMemObject(table);
   if(pixelBuffer != NULL) free(pixelBuffer);
   AG_MutexDestroy(&mutex_buffer);
   AG_MutexDestroy(&mutex_palette);
}
DumpObject::~DumpObject()
{
    AG_MutexLock(&mutex);
//    if(TextFont != NULL) AG_DestroyFont(TextFont);
//    if(SymFont != NULL) AG_DestroyFont(SymFont);
    if(ConsoleBuf != NULL) delete [] ConsoleBuf;
    if(BackupConsoleBuf != NULL) delete [] BackupConsoleBuf;
    AG_MutexUnlock(&mutex);
    AG_MutexDestroy(&mutex);
}
Esempio n. 3
0
void
AU_WaveFree(AU_Wave *w)
{
	if (w->file != NULL) {
		sf_close(w->file);
	}
	AU_WaveFreeData(w);
	AG_MutexDestroy(&w->lock);
	Free(w);
}
Esempio n. 4
0
static void
Destroy(void)
{
	if (WSACleanup() == SOCKET_ERROR &&
	    WSAGetLastError() == WSAEINPROGRESS) {
#ifndef _WIN32_WCE
		WSACancelBlockingCall();
#endif
		WSACleanup();
	}
	AG_MutexDestroy(&agNetWin32Lock);
}
Esempio n. 5
0
File: anim.c Progetto: adsr/agar
/* Free the specified animation. */
void
AG_AnimFree(AG_Anim *a)
{
	int i;

	AG_PixelFormatFree(a->format);
	AG_MutexDestroy(&a->lock);

	for (i = 0; i < a->n; i++) {
		AG_AnimFrame *af = &a->f[i];
		Free(af->pixels);
	}
	Free(a->f);
	Free(a);
}
Esempio n. 6
0
void OnDestroy(AG_Event *event)
{
   // 20120610 GUI関連処理
   bEventRunFlag = FALSE; 
#ifdef _WITH_DEBUGGER
   Detach_DebugMenu();
#endif
   /*
    * サウンド停止
    */
   StopSnd();
   SaveCfg();
   AG_ConfigSave();
   /*
    * コンポーネント クリーンアップ
    */
#ifdef FDDSND
   CleanFDDSnd();
#endif				/*  */
   CleanSch();
   CleanKbd();
   CleanSnd();
   CleanDraw();
   DestroyStatus();

   /*
    * 仮想マシン クリーンアップ
    */
   system_cleanup();
   if(pCpuID != NULL) {
      detachCpuID(pCpuID);
      pCpuID = NULL;
   }


   AG_MutexDestroy(&VMMutex);
//   AG_Destroy();
#if 0 
   muntrace();
#endif
   DiscardTextures(1, &uVramTextureID);
   DiscardTextures(1, &uNullTextureID);
   uVramTextureID = 0;
   XM7_DebugLog(XM7_LOG_INFO, "All resources allocated by VM were freed.");
//   AG_Destroy();
}
Esempio n. 7
0
File: anim.c Progetto: adsr/agar
void
AG_AnimStateDestroy(AG_Anim *an, AG_AnimState *ast)
{
	ast->play = 0;
	AG_MutexDestroy(&ast->lock);
}