Re: passing object references [message #13464 is a reply to message #13461] |
Wed, 11 November 1998 00:00   |
philip aldis
Messages: 13 Registered: October 1998
|
Junior Member |
|
|
David Fanning wrote:
> Then I would like to see how you are storing it in your info structure.
> Or, another possibility, did you destroy the first widget program to
> run the Animator program? If so, your clean-up routine on the first
> program destroyed the object. If this is happening, you may have to
> make an actual copy of the object itself and pass that. I just added
> a tip on my web page about how to do this:
>
> http://www.dfanning.com/tips/copy_objects.html
>
Well what a surprise, the mistake was in the place that was far too obvious to
even consider, that indeed the object wasn't valid, and that I had deleted it
myself. I had called the animator program, and then in the next line of code
destroyed the loader widget, which destroyed the object, but did so only after
the first lot of animator code had executed. Thus the object was onlt invalid
when the vent handlers were being used.
The only problem with copying the object is that it has another object, and
many pointers, and so will be a little fiddly. So, what about having a flag in
my info structure which is only set when I have called the animation prog. and
cleanup only destroys the object if flag is set to 0, i.e. if the user quitted
out before calling animation program - bit messy, but it should work.
cheers,
Phil Aldis
____________________________________________________________ ______________
Philip Aldis
Room B803/4
DERA Malvern tel:0044 1684 897241
St.Andrew's Road fax:0044 1684 894185
WR14 3PS
England
____________________________________________________________ ______________
The information contained in this e-mail and any subsequent correspondence is
private and is intended solely for the intended recipient(s). For those other
than the intended recipient(s) any disclosure, copying, distribution, or any
action taken or omitted to be taken in reliance on such information is
prohibited and may be unlawful.
____________________________________________________________ ______________
DERA disclaimer:
The views expressed above are entirely those of the writer and do not
represent the views, policy or understandingof any other person or official
body.
____________________________________________________________ ______________
|
|
|