static void fb_exitinstance(WINDISPLAY *mod) { struct TExecBase *TExecBase = TGetExecBase(mod); struct TNode *imsg, *node, *next; /* free pooled input messages: */ while ((imsg = TRemHead(&mod->fbd_IMsgPool))) TFree(imsg); /* free queued input messages in all open visuals: */ node = mod->fbd_VisualList.tlh_Head; for (; (next = node->tln_Succ); node = next) { WINWINDOW *v = (WINWINDOW *) node; /* unset active font in all open visuals */ v->fbv_CurrentFont = TNULL; while ((imsg = TRemHead(&v->fbv_IMsgQueue))) TFree(imsg); } /* force closing of default font */ mod->fbd_FontManager.defref = 0; /* close all fonts */ node = mod->fbd_FontManager.openfonts.tlh_Head; for (; (next = node->tln_Succ); node = next) fb_hostclosefont(mod, (TAPTR) node); if (mod->fbd_DeviceHWnd) DestroyWindow(mod->fbd_DeviceHWnd); if (mod->fbd_ClassAtom) UnregisterClass(FB_DISPLAY_CLASSNAME, mod->fbd_HInst); if (mod->fbd_ClassAtomPopup) UnregisterClass(FB_DISPLAY_CLASSNAME_POPUP, mod->fbd_HInst); }
LOCAL void fb_closefont(WINDISPLAY *mod, struct TVRequest *req) { fb_hostclosefont(mod, req->tvr_Op.CloseFont.Font); }