MCPcopy Create free account
hub / github.com/SimHacker/micropolis / Tk_FreeBitmap

Function Tk_FreeBitmap

micropolis-activity/src/tk/tkbitmap.c:374–397  ·  view source on GitHub ↗
(bitmap)

Source from the content-addressed store, hash-verified

372 * Side effects:
373 * The reference count associated with bitmap is decremented, and
374 * it is officially deallocated if no-one is using it anymore.
375 *
376 *----------------------------------------------------------------------
377 */
378
379void
380Tk_FreeBitmap(bitmap)
381 Pixmap bitmap; /* Bitmap to be released. */
382{
383 Tcl_HashEntry *idHashPtr;
384 register TkBitmap *bitmapPtr;
385
386 if (!initialized) {
387 panic("Tk_FreeBitmap called before Tk_GetBitmap");
388 }
389
390 idHashPtr = Tcl_FindHashEntry(&idTable, (char *) bitmap);
391 if (idHashPtr == NULL) {
392 panic("Tk_FreeBitmap received unknown bitmap argument");
393 }
394 bitmapPtr = (TkBitmap *) Tcl_GetHashValue(idHashPtr);
395 bitmapPtr->refCount--;
396 if (bitmapPtr->refCount == 0) {
397 XFreePixmap(bitmapPtr->display, bitmapPtr->bitmap);
398 Tcl_DeleteHashEntry(idHashPtr);
399 Tcl_DeleteHashEntry(bitmapPtr->hashPtr);
400 ckfree((char *) bitmapPtr);

Callers 15

DoConfigFunction · 0.85
DestroyButtonFunction · 0.85
Tk_Free3DBorderFunction · 0.85
DeleteTextFunction · 0.85
DestroyMenuFunction · 0.85
DestroyMenuEntryFunction · 0.85
DeleteArcFunction · 0.85
TkTextFreeTagFunction · 0.85
DeletePolygonFunction · 0.85
TkWmDeadWindowFunction · 0.85
Tk_WmCmdFunction · 0.85
DeleteBitmapFunction · 0.85

Calls 2

panicFunction · 0.85
Tcl_DeleteHashEntryFunction · 0.85

Tested by

no test coverage detected