summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
+ }
+}