示例#1
0
文件: gl_init.c 项目: UIKit0/picogui
void gl_close(void) {
    if (gl_global.h_infilter)
        handle_free(-1,gl_global.h_infilter);

    if (gl_global.display_rend) {
        g_free(gl_global.display_rend);
        gl_global.display_rend = NULL;
    }

    unload_inlib(gl_global.continuous_inlib);

    if (gl_global.osd_font)
        font_descriptor_destroy(gl_global.osd_font);
}
示例#2
0
文件: handle.c 项目: scanlime/picogui
/* Free any object in a handlenode */
void object_free(struct handlenode *n) {
#ifdef DEBUG_KEYS
  num_handles--;
#endif
#ifdef DEBUG_MEMORY
  printf("Enter object free of handle 0x%08X, type %d\n",n->id,n->type &
	 PG_TYPEMASK);
#endif
  if (!(n->type & HFLAG_NFREE)) {
    switch (n->type & PG_TYPEMASK) {

    case PG_TYPE_BITMAP:
      VID(bitmap_free) ((hwrbitmap)n->obj);
      break;

    case PG_TYPE_WIDGET:
      widget_remove((struct widget *)n->obj);
      break;

    case PG_TYPE_THEME:
      theme_remove((struct pgmemtheme *)n->obj);
      break;

    case PG_TYPE_DRIVER:
      unload_inlib((struct inlib *)n->obj);
      break;

    case PG_TYPE_WT:
      wt_free((struct pgmemwt *)n->obj);
      break;

    case PG_TYPE_INFILTER:
      infilter_delete((struct infilter *)n->obj);
      break;

    case PG_TYPE_CURSOR:
      cursor_delete((struct cursor *)n->obj);
      break;

    case PG_TYPE_PGSTRING:
      pgstring_delete((struct pgstring *)n->obj);
      break;

    case PG_TYPE_FONTDESC:
      font_descriptor_destroy((struct font_descriptor *)n->obj);
      break;

      /* Object types that are memory-managed independently of their handles */
    case PG_TYPE_DIVTREE:
    case PG_TYPE_PARAGRAPH:
      break;

    default:
      g_free(n->obj);
    }
  }
#ifdef DEBUG_MEMORY
  printf("Leave object free of handle 0x%08X, type %d\n",n->id,n->type &
	 PG_TYPEMASK);
#endif
}