diff options
author | hobbs <hobbs@noemail.net> | 2002-04-12 10:03:02 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2002-04-12 10:03:02 (GMT) |
commit | ae73ae494a25d3fbd74abca221bfdc035325c1b0 (patch) | |
tree | 5af76093a740c78301ef4e4d70653892f48e8f6e /generic/tkClipboard.c | |
parent | 82518357bea364a488b5bcdb03bc1aa794384df5 (diff) | |
download | tk-ae73ae494a25d3fbd74abca221bfdc035325c1b0.zip tk-ae73ae494a25d3fbd74abca221bfdc035325c1b0.tar.gz tk-ae73ae494a25d3fbd74abca221bfdc035325c1b0.tar.bz2 |
generic/tkClipboard.c (TkClipCleanup): frees TkDisplay data
FossilOrigin-Name: be926d02c7f94ba9ec7fd8b58167fc4b9d8fea35
Diffstat (limited to 'generic/tkClipboard.c')
-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 |