diff options
-rw-r--r-- | generic/tkClipboard.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 9558d0c..149f65d 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkClipboard.c,v 1.8 2002/01/17 05:13:11 dgp Exp $ + * RCS: @(#) $Id: tkClipboard.c,v 1.9 2002/04/12 10:03:02 hobbs Exp $ */ #include "tkInt.h" @@ -623,6 +623,44 @@ Tk_ClipboardObjCmd(clientData, interp, objc, objv) /* *---------------------------------------------------------------------- * + * 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); + /* + * It may be too late to call Tk_DestroyWindow, so just free the + * memory created directly. + */ + ckfree((char *) dispPtr->clipWindow); + dispPtr->clipWindow = NULL; + } +} + +/* + *---------------------------------------------------------------------- + * * TkClipInit -- * * This procedure is called to initialize the window for claiming |