Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!ben From: ben@hpcvlx.cv.hp.com (Benjamin Ellsworth) Newsgroups: comp.windows.x Subject: Re: Returning from XtMalloc?? Message-ID: <100920182@hpcvlx.cv.hp.com> Date: 1 Mar 90 17:56:36 GMT References: <9002271554.AA12993@ra.> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 26 I wrote: >> However, the Xt versions don't seem to return if space can't be >> allocated. > > Huh? Look at Alloc.c in the Xt source and help me understand why they > wouldn't return, and why it would be Xt's fault. > >> Steve Pothier I had assumed that what was meant by "don't seem to return" was a prgram hang. Mea culpa. It is true that in an error condition XtError is called and XtError will not return (exit is called). This should be accompanied by and error message. (The error message was not mentioned so I thought we were talking about a different problem.) If you really want to continue after a malloc error, you could install your own XtError handler. Some pitfalls are, not easily determining who called the XtError (it is called by more than XtMalloc), and how to continue --what if it is an Xt intrinsic call which runs out of memory, like XtCreateWidget? --- Ben