diff options
author | hobbs <hobbs@noemail.net> | 2002-04-12 10:03:24 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2002-04-12 10:03:24 (GMT) |
commit | a052dc724331f3d77a0b447008a808eb8313f576 (patch) | |
tree | 425b8fd106f523b0f1f35766019edbd0962af7f4 /generic/tkFocus.c | |
parent | ae73ae494a25d3fbd74abca221bfdc035325c1b0 (diff) | |
download | tk-a052dc724331f3d77a0b447008a808eb8313f576.zip tk-a052dc724331f3d77a0b447008a808eb8313f576.tar.gz tk-a052dc724331f3d77a0b447008a808eb8313f576.tar.bz2 |
generic/tkFocus.c (TkFocusFree): frees TkMainInfo data
FossilOrigin-Name: dc644f1a82672f30183063e0b5ad27eaa78e5b67
Diffstat (limited to 'generic/tkFocus.c')
-rw-r--r-- | generic/tkFocus.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/generic/tkFocus.c b/generic/tkFocus.c index 1d91495..c50fc3d 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFocus.c,v 1.6 2002/01/17 05:13:11 dgp Exp $ + * RCS: @(#) $Id: tkFocus.c,v 1.7 2002/04/12 10:03:24 hobbs Exp $ */ #include "tkInt.h" @@ -1012,3 +1012,39 @@ FindDisplayFocusInfo(mainPtr, dispPtr) mainPtr->displayFocusPtr = displayFocusPtr; return displayFocusPtr; } + +/* + *---------------------------------------------------------------------- + * + * TkFocusFree -- + * + * Free resources associated with maintaining the focus. + * + * Results: + * None. + * + * Side effects: + * This mainPtr should no long access focus information. + * + *---------------------------------------------------------------------- + */ + +void +TkFocusFree(mainPtr) + TkMainInfo *mainPtr; /* Record that identifies a particular + * application. */ +{ + DisplayFocusInfo *displayFocusPtr; + ToplevelFocusInfo *tlFocusPtr; + + while (mainPtr->displayFocusPtr != NULL) { + displayFocusPtr = mainPtr->displayFocusPtr; + mainPtr->displayFocusPtr = mainPtr->displayFocusPtr->nextPtr; + ckfree((char *) displayFocusPtr); + } + while (mainPtr->tlFocusPtr != NULL) { + tlFocusPtr = mainPtr->tlFocusPtr; + mainPtr->tlFocusPtr = mainPtr->tlFocusPtr->nextPtr; + ckfree((char *) tlFocusPtr); + } +} |