1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1990 The Regents of the University of California.
|
3 |
|
|
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
4 |
|
|
'\"
|
5 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
6 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
7 |
|
|
'\"
|
8 |
|
|
'\" RCS: @(#) $Id: FreeXId.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
|
9 |
|
|
'\"
|
10 |
|
|
.so man.macros
|
11 |
|
|
.TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures"
|
12 |
|
|
.BS
|
13 |
|
|
.SH NAME
|
14 |
|
|
Tk_FreeXId \- make X resource identifier available for reuse
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
.nf
|
17 |
|
|
\fB#include \fR
|
18 |
|
|
.sp
|
19 |
|
|
\fBTk_FreeXId(\fIdisplay, id\fB)\fR
|
20 |
|
|
.SH ARGUMENTS
|
21 |
|
|
.AS Display *display out
|
22 |
|
|
.AP Display *display in
|
23 |
|
|
Display for which \fIid\fR was allocated.
|
24 |
|
|
.AP XID id in
|
25 |
|
|
Identifier of X resource (window, font, pixmap, cursor, graphics
|
26 |
|
|
context, or colormap) that is no longer in use.
|
27 |
|
|
.BE
|
28 |
|
|
|
29 |
|
|
.SH DESCRIPTION
|
30 |
|
|
.PP
|
31 |
|
|
The default allocator for resource identifiers provided by Xlib is very
|
32 |
|
|
simple-minded and does not allow resource identifiers to be re-used.
|
33 |
|
|
If a long-running application reaches the end of the resource id
|
34 |
|
|
space, it will generate an X protocol error and crash.
|
35 |
|
|
Tk replaces the default id allocator with its own allocator, which
|
36 |
|
|
allows identifiers to be reused.
|
37 |
|
|
In order for this to work, \fBTk_FreeXId\fR must be called to
|
38 |
|
|
tell the allocator about resources that have been freed.
|
39 |
|
|
Tk automatically calls \fBTk_FreeXId\fR whenever it frees a
|
40 |
|
|
resource, so if you use procedures like \fBTk_GetFontStruct\fR,
|
41 |
|
|
\fBTk_GetGC\fR, and \fBTk_GetPixmap\fR then you need not call
|
42 |
|
|
\fBTk_FreeXId\fR.
|
43 |
|
|
However, if you allocate resources directly from Xlib, for example
|
44 |
|
|
by calling \fBXCreatePixmap\fR, then you should call \fBTk_FreeXId\fR
|
45 |
|
|
when you call the corresponding Xlib free procedure, such as
|
46 |
|
|
\fBXFreePixmap\fR.
|
47 |
|
|
If you don't call \fBTk_FreeXId\fR then the resource identifier will
|
48 |
|
|
be lost, which could cause problems if the application runs long enough
|
49 |
|
|
to lose all of the available identifiers.
|
50 |
|
|
|
51 |
|
|
.SH KEYWORDS
|
52 |
|
|
resource identifier
|