/*
 * -- $Header: /cec/src/nestor/servers/R3/shXlib/XFreeCmap.c,v 1.2 90/05/14 08:57:22 altenhof Exp $
 */

#include "copyright.h"

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

/* -- MULTIPLEX Extension -- */

#include "Xlibint.h"

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

XFreeColormap(dpy, cmap)
register Display *dpy;
Colormap cmap;
{
    register xResourceReq *req;

    /* -- don't free resources that are still referenced -- */
    if( XmuXColormapStillReferenced( dpy , cmap ) )
      return ;
    LockDisplay(dpy);
    GetResReq(FreeColormap, cmap, req);

    /* -- free the resource info if necessary -- */
    if( XmuXStoreResources( dpy ) )
	XmuXRemoveColormapInfo( dpy , cmap ) ;
    UnlockDisplay(dpy);
    SyncHandle();
}
