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

Function Tk_DeleteBindingTable

micropolis-activity/src/tk/tkbind.c:483–517  ·  view source on GitHub ↗
(bindingTable)

Source from the content-addressed store, hash-verified

481 *
482 *--------------------------------------------------------------
483 */
484
485void
486Tk_DeleteBindingTable(bindingTable)
487 Tk_BindingTable bindingTable; /* Token for the binding table to
488 * destroy. */
489{
490 BindingTable *bindPtr = (BindingTable *) bindingTable;
491 PatSeq *psPtr, *nextPtr;
492 Tcl_HashEntry *hPtr;
493 Tcl_HashSearch search;
494
495 /*
496 * Find and delete all of the patterns associated with the binding
497 * table.
498 */
499
500 for (hPtr = Tcl_FirstHashEntry(&bindPtr->patternTable, &search);
501 hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
502 for (psPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
503 psPtr != NULL; psPtr = nextPtr) {
504 nextPtr = psPtr->nextSeqPtr;
505 Tk_EventuallyFree((ClientData) psPtr->command,
506 (Tk_FreeProc *) free);
507 ckfree((char *) psPtr);
508 }
509 }
510
511 /*
512 * Clean up the rest of the information associated with the
513 * binding table.
514 */
515
516 Tcl_DeleteHashTable(&bindPtr->patternTable);
517 Tcl_DeleteHashTable(&bindPtr->objectTable);
518 ckfree((char *) bindPtr);
519}
520

Callers 3

DestroyCanvasFunction · 0.85
Tk_DestroyWindowFunction · 0.85
DestroyTextFunction · 0.85

Calls 2

Tk_EventuallyFreeFunction · 0.85
Tcl_DeleteHashTableFunction · 0.85

Tested by

no test coverage detected