[comp.windows.x] Possible problem in XtGetApplicationResources

mikeo@sae.UUCP (Mike Ovington Overhead) (04/21/89)

   X11R3 Sun 3/50 SunOS 3.5, purdue speedups
      I have an application in which I am creating an XtResourceList
   dynamically. The number of resources in the list is determined
   at run time by a different resource. When I call
   XtGetApplicationResources with this new resource list, the fields
   of the resource list are being overwritten by XrmCompileResourceList.

      Ordinarily, this won't cause problems, but in my case, it overwrote
   (in each resource's resource_name) my only pointer to the heap
   storage that contained the name of the resource. I consequently run
   into problems when I try to free that string. I've worked around
   it by keeping a copy of the pointer but my question is:

   Is this behavior documented anywhere?
   I get the same behavior in both R2 and R3, and have checked
   the Resource Management documentation more than once and haven't
   found a reference.
   I haven't seen any other applications that build an XtResourceList
   at runtime. Is it something that just wasn't anticipated, or is it
   not supposed to be allowed.

Michael S. Ovington
witten@nrl-css.arpa

asente@decwrl.dec.com (Paul Asente) (04/21/89)

Summary:  when you use a resource list it gets compiled and the original
string pointers are overwritten.

This should be documented in the spec (and will be).  We didn't consider
that people might be using dynamic resource lists with other than constant
strings in them.

	-paul asente
	    asente@decwrl.dec.com	decwrl!asente