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

Home » Public Forums » archive » Object Madness or Restoring Nightmares
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Object Madness or Restoring Nightmares [message #38368] Tue, 02 March 2004 16:08 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

Don't you just hate it when you think you understand
something, only to realize (usually at a critical time)
that you don't?

Maybe I've been doing too much programming and not playing
enough tennis lately, but I feel t-i-r-e-d. Good thing
the ol' physical is tomorrow. Maybe I ask for some of those
tiny blue programming pills. :-)

Anyway, here's the deal. I have an object containing
several other objects. All of these objects know how to
clean themselves up. If I destroy the main object, let's
call it the "study object", then all is fine. No memory
leakage.

Now, I want to save this object in my IDL application.
The idea is that I can have several sessions hanging
around and I can restore and continue working on any
of several different studies. So no problem saving
the session as an IDL save file:

currentStudy = self.currentStudy
Save, Filename='somename.sav', currentStudy

And I can restore it OK:

Obj_Destroy, self.currentStudy
Restore, Filename='somename.sav'
self.currentStudy = curentStudy

This works great....*except* when I restore like this
and exit my application (thereby doing an Obj_Destroy
on self.currentStudy), I am left with *lots* of leaking
memory. I don't know why. (Or, more accurately, I think
I *do* know why, I just can't remember it.)

I've proved that it is not the save/restore cycle that is
doing this, because if the study contains just non-objects,
say images, then there is no memory leakage. Only when the
study contains objects do I leak.

Any good ideas?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: HDF5 and IDL
Next Topic: Re: how to make a mask from a picture and how to put...

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

Current Time: Fri Oct 10 16:28:11 PDT 2025

Total time taken to generate the page: 1.43947 seconds