From 197b4b9a5236ad16a01f09f391f3e5a46decab27 Mon Sep 17 00:00:00 2001 From: hobbs Date: Fri, 12 Apr 2002 10:03:24 +0000 Subject: generic/tkFocus.c (TkFocusFree): frees TkMainInfo data --- generic/tkFocus.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) 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); + } +} -- cgit v0.12