示例#1
0
static void rfb_exittask(struct rfb_Display *mod)
{
	TAPTR TExecBase = TGetExecBase(mod);
	struct TNode *imsg, *node, *next;

#if defined(ENABLE_LINUXFB)
	rfb_linux_exit(mod);
#endif

	TFree(mod->rfb_PtrBackBuffer.data);
	if (mod->rfb_Flags & RFBFL_PTR_ALLOCATED)
		TFree(mod->rfb_PtrImage.tpb_Data);

	/* free pooled input messages: */
	while ((imsg = TRemHead(&mod->rfb_IMsgPool)))
		TFree(imsg);

	/* close all fonts */
	node = mod->rfb_FontManager.openfonts.tlh_Head.tln_Succ;
	for (; (next = node->tln_Succ); node = next)
		rfb_hostclosefont(mod, (TAPTR) node);

	if (mod->rfb_Flags & RFBFL_BUFFER_OWNER)
		TFree(mod->rfb_PixBuf.tpb_Data);

	TDestroy(mod->rfb_RndIMsgPort);
	TFree(mod->rfb_RndRequest);
	TCloseModule(mod->rfb_RndDevice);
	TDestroy((struct THandle *) mod->rfb_RndRPort);
	TDestroy((struct THandle *) mod->rfb_InstanceLock);

	region_free(&mod->rfb_RectPool, &mod->rfb_DirtyRegion);

	region_destroypool(&mod->rfb_RectPool);
}
示例#2
0
static void rfb_exittask(RFBDISPLAY *mod)
{
	TAPTR TExecBase = TGetExecBase(mod);
	struct TNode *imsg, *node, *next;

	/* free pooled input messages: */
	while ((imsg = TRemHead(&mod->rfb_IMsgPool)))
		TFree(imsg);

	/* close all fonts */
	node = mod->rfb_FontManager.openfonts.tlh_Head;
	for (; (next = node->tln_Succ); node = next)
		rfb_hostclosefont(mod, (TAPTR) node);

	if (mod->rfb_BufferOwner)
		TFree(mod->rfb_BufPtr);
	
	TDestroy(mod->rfb_RndIMsgPort);
	TFree(mod->rfb_RndRequest);
	TCloseModule(mod->rfb_RndDevice);
	TDestroy((struct THandle *) mod->rfb_RndRPort);
	TDestroy((struct THandle *) mod->rfb_InstanceLock);
	
	if (mod->rfb_DirtyRegion)
		region_destroy(&mod->rfb_RectPool, mod->rfb_DirtyRegion);
	
	region_destroypool(&mod->rfb_RectPool);
}
示例#3
0
static void
vis_exit(struct TVisualBase *mod)
{
	struct TExecBase *TExecBase = TGetExecBase(mod);
	if (mod->vis_Displays)
	{
		struct TList dlist;
		struct TNode *next, *node;

		if (mod->vis_InitRequest)
			TDisplayFreeReq((struct TDisplayBase *)
				mod->vis_InitRequest->tvr_Req.io_Device,
				mod->vis_InitRequest);

		TInitList(&dlist);
		vis_hashtolist(mod, mod->vis_Displays, &dlist);
		for (node = dlist.tlh_Head; (next = node->tln_Succ); node = next)
		{
			#if defined(VISUAL_USE_INTERNAL_HASH)
			struct TModule *dmod = (struct TModule *)
				((struct vis_HashNode *) node)->value;
			#else
			struct TModule *dmod = (struct TModule *)
				((struct THashNode *) node)->thn_Value;
			#endif
			TCloseModule(dmod);
		}

		vis_destroyhash(mod, mod->vis_Displays);
	}
}