Article View: comp.windows.x
Article #24178Xt Resource Cache Counting
From: Doyle C. Davidson
Date: Thu, 27 Jun 1991 21:38
Date: Thu, 27 Jun 1991 21:38
35 lines
1899 bytes
1899 bytes
Regarding resource cache counting:
Say I have a widget of class fooClass with an XtNforeground resource.
Suppose I want to change the foreground color (let's say I want to
blink the widget) so I get an alternate color via:
XtConvertAndStore(w, XtRString, &src, XtRPixel, &dest);
Xt adds a XtNdestroyCallback to the widget to decrement the
resource's reference count and free the cached resource if zero.
Right?
To use the same color for a second widget, I must then call
XtConvertAndStore again if I want to properly maintain the
resource cache count. Correct?
Because, if I don't, and I destroy the first widget (the one
used in the XtConvertAndStore) my reference count could
possible reach zero even though the second widget still
may use that secondary pixel value.
Doyle
"I fear explanations explanatory of things explained." -- unknown
------------------------------------------------------------------
Doyle C. Davidson |
Intergraph Corp. | These comments are...
Everywhere You Look!! |
Third Party Software |
Product Development | \\ /
(205) 730-2000 | \\/
| /\\ clusively my own.
..!b23b!doyled!doyle -or- | / \\
...ingr.com!doyle |
------------------------------------------------------------------
Technical Details
Message-ID:
<1991Jun27.213802.28113@infonode.ingr.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!infonode!doyled.b23b.ingr!doyleShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!infonode!doyled.b23b.ingr!doyle From: doyle@doyled.b23b.ingr (Doyle C. Davidson) Newsgroups: comp.windows.x Subject: Xt Resource Cache Counting Keywords: Xt resources Message-ID: <1991Jun27.213802.28113@infonode.ingr.com> Date: 27 Jun 91 21:38:02 GMT Sender: usenet@infonode.ingr.com (Usenet Administrator) Reply-To: doyle@doyled.b23b.ingr.com Organization: Intergraph Corporation - Third Party Software Lines: 35