summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-04-12 10:03:24 (GMT)
committerhobbs <hobbs>2002-04-12 10:03:24 (GMT)
commit197b4b9a5236ad16a01f09f391f3e5a46decab27 (patch)
tree425b8fd106f523b0f1f35766019edbd0962af7f4
parent5d979f7986281109d4edaa513c46e0178e994e76 (diff)
downloadtk-197b4b9a5236ad16a01f09f391f3e5a46decab27.zip
tk-197b4b9a5236ad16a01f09f391f3e5a46decab27.tar.gz
tk-197b4b9a5236ad16a01f09f391f3e5a46decab27.tar.bz2
generic/tkFocus.c (TkFocusFree): frees TkMainInfo data
-rw-r--r--generic/tkFocus.c38
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);
+ }
+}