/*
 * -- $Header: /cec/src/nestor/servers/R3/shXlib/XUnldFont.c,v 1.1.1.1 90/04/23 10:09:01 spanachi Exp $
 */

#include "copyright.h"

/* $XConsortium: XUnldFont.c,v 11.6 88/09/06 16:11:16 jim Exp $ */
/* Copyright    Massachusetts Institute of Technology    1986	*/

/* -- MULTIPLEX Extension -- */

#include "Xlibint.h"

/* additional includes -- */
#include "resources.h"

XUnloadFont(dpy, font)
     register Display *dpy;
     Font font;

{       
    register xResourceReq *req;

    /*
     * -- CAUTION : Dangling resource reference ! 
     * -- This font may have been used by the application to create a glyph
     * -- cursor. We can't throw it away if the cursor is still in use
     */
    if( XmuXFontStillReferenced( dpy , font ) )
	return ;

    LockDisplay(dpy);
    GetResReq(CloseFont, font, req);

    /* -- free the resource info if the resource is freed by the client -- */
    if( XmuXStoreResources( dpy ) )
	XmuXRemoveFontInfo( dpy , font ) ;

    UnlockDisplay(dpy);
    SyncHandle();
}

