diff options
author | hobbs <hobbs> | 2002-04-12 10:03:24 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-04-12 10:03:24 (GMT) |
commit | 2fc0141f2970abc0e5c9b95c5dd522d090797402 (patch) | |
tree | 425b8fd106f523b0f1f35766019edbd0962af7f4 /generic/tkFocus.c | |
parent | 380bc30ec6e286bc12cd2bf6e0d344e9ffe87c0a (diff) | |
download | tk-2fc0141f2970abc0e5c9b95c5dd522d090797402.zip tk-2fc0141f2970abc0e5c9b95c5dd522d090797402.tar.gz tk-2fc0141f2970abc0e5c9b95c5dd522d090797402.tar.bz2 |
generic/tkFocus.c (TkFocusFree): frees TkMainInfo data
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); + } +} |