summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixEvent.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 0a42ccb..f06c0ca 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixEvent.c,v 1.15 2004/01/31 20:27:52 jenglish Exp $
+ * RCS: @(#) $Id: tkUnixEvent.c,v 1.16 2004/05/03 22:28:45 hobbs Exp $
*/
#include "tkInt.h"
@@ -241,6 +241,42 @@ TkpCloseDisplay(dispPtr)
/*
*----------------------------------------------------------------------
*
+ * TkClipCleanup --
+ *
+ * This procedure is called to cleanup resources associated with
+ * claiming clipboard ownership and for receiving selection get
+ * results. This function is called in tkWindow.c. This has to be
+ * called by the display cleanup function because we still need the
+ * access display elements.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Resources are freed - the clipboard may no longer be used.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkClipCleanup(dispPtr)
+ TkDisplay *dispPtr; /* display associated with clipboard */
+{
+ if (dispPtr->clipWindow != NULL) {
+ Tk_DeleteSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
+ dispPtr->applicationAtom);
+ Tk_DeleteSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
+ dispPtr->windowAtom);
+
+ Tk_DestroyWindow(dispPtr->clipWindow);
+ Tcl_Release((ClientData) dispPtr->clipWindow);
+ dispPtr->clipWindow = NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* DisplaySetupProc --
*
* This procedure implements the setup part of the UNIX X display