comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Surprising Odds and Ends
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Surprising Odds and Ends [message #21234 is a reply to message #21228] Tue, 15 August 2000 00:00 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
David Fanning wrote:
>
> [ far too many words about a routine that one should not use anyway ;-) ]
> [ and then ... ]
> I crashed my widget program in an event handler with
> the info structure checked out with NO_COPY. I stop,
> as I am suppose to, in the event handler module where
> the info structure *is* defined, which has the pointer
> reference inside it.
> [...][/color]

Seems to me as if your problem is related to a somewhat sloppy
distinction
between "global" and "local" information. To my understanding, the
Cleanup routine
only exists to clean up "global" mess, i.e. stuff that can be accessed
via a
well-defined interface (may this be the UValue field of TLB or its
child, or
may these be object fields). From what I leardned from your programs ,
the
info structure which gets parsed by the event handler would instead
contain
a local pointer, i.e. something that has a finite lifetime and was
created specifically
to serve an event. Therefore, the solution should be to free the pointer
within
your event handler routine BEFORE calling the cleanup routine.

In plain words:

CATCH, theError
IF theError NE 0 THEN BEGIN
CATCH, /Cancel
Message,...
IF Ptr_Valid(info.thepointer) THEN Ptr_Free, info.thepointer
Cleanup
ENDIF

If the crash happens in a routine which you never expected to crash,
well then you
apparently caught an oversight by the programmer, and he should be told
to fix the
bug. In this case, a .reset_session usually helps ;-)

Cheers,
Martin



--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Throwing Widget Events?
Next Topic: Throwing Widget Events?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 18 13:47:29 PDT 2025

Total time taken to generate the page: 1.20016 seconds