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

Home » Public Forums » archive » Re: Catalyst CatDestroyDefaults
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Catalyst CatDestroyDefaults [message #67079] Tue, 23 June 2009 18:30
dosfun is currently offline  dosfun
Messages: 14
Registered: February 2009
Junior Member
On 6月23日, 下午9时26分, David Fanning <n...@dfanning.com> wrote:
> Crane writes:
>> I am trying to use CatSetDefault to set some of my system settings,
>> for instance:
>
>> oLang = Obj_New('languageclass')
>> CatSetDefault, 'language', oLang
>
>> When my application is destroyed, the CatDestroyDefaults is called
>> automatically, I expected this procedure will clean up all system
>> settings, so I did not destroy the oLang object by myself.
>> Unfortunately, oLang is not cleaned up, it is still in memory. Should
>> I have to explicitly destory the system settings in cleanup method ,
>> or where am I wrong?
>
>> I try to find what happens using debug mode, and know the
>> CatDestroyDefaults procedure finally go to the CatContainer::Cleanup
>> method, this method remove all child objects so they don't get
>> destroyed automatically, I think this is why oLang is not destroy.
>
>> I do not understand this, because we need CatDestroyDefaults to
>> automatically destroy all the system settings when we destroy the
>> application.
>
> It is probably appropriate that this comes on the heels of
> another discussion a week or so ago about the inability of
> UNDEFINE to undefine everything. And the reason for the problem
> is similar. It never occurred to me to store a heap variable
> in a Catalyst default value. ;-)
>
> But, now I know someone wants to do that, the solution is simple.
> If the internal pointer points to a heap variable, destroy that, too.
> And since I already spent an hour getting UNDEFINE to do just that
> a week ago, I decided to use that to get the job done.
>
> So, be sure you have the latest UNDEFINE, and you can download
> a new CatListValue object here:
>
> http://www.dfanning.com/programs/undefine.pro
> .../programs/catalyst/source/core/catlistvalue__define.pro
>
> Tested only lightly, as I am late for work, as usual. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Very thanks, wonderful.
Re: Catalyst CatDestroyDefaults [message #67080 is a reply to message #67079] Tue, 23 June 2009 18:21 Go to previous message
dosfun is currently offline  dosfun
Messages: 14
Registered: February 2009
Junior Member
On 6月23日, 下午9时26分, David Fanning <n...@dfanning.com> wrote:
> Crane writes:
>> I am trying to use CatSetDefault to set some of my system settings,
>> for instance:
>
>> oLang = Obj_New('languageclass')
>> CatSetDefault, 'language', oLang
>
>> When my application is destroyed, the CatDestroyDefaults is called
>> automatically, I expected this procedure will clean up all system
>> settings, so I did not destroy the oLang object by myself.
>> Unfortunately, oLang is not cleaned up, it is still in memory. Should
>> I have to explicitly destory the system settings in cleanup method ,
>> or where am I wrong?
>
>> I try to find what happens using debug mode, and know the
>> CatDestroyDefaults procedure finally go to the CatContainer::Cleanup
>> method, this method remove all child objects so they don't get
>> destroyed automatically, I think this is why oLang is not destroy.
>
>> I do not understand this, because we need CatDestroyDefaults to
>> automatically destroy all the system settings when we destroy the
>> application.
>
> It is probably appropriate that this comes on the heels of
> another discussion a week or so ago about the inability of
> UNDEFINE to undefine everything. And the reason for the problem
> is similar. It never occurred to me to store a heap variable
> in a Catalyst default value. ;-)
>
> But, now I know someone wants to do that, the solution is simple.
> If the internal pointer points to a heap variable, destroy that, too.
> And since I already spent an hour getting UNDEFINE to do just that
> a week ago, I decided to use that to get the job done.
>
> So, be sure you have the latest UNDEFINE, and you can download
> a new CatListValue object here:
>
> http://www.dfanning.com/programs/undefine.pro
> .../programs/catalyst/source/core/catlistvalue__define.pro
>
> Tested only lightly, as I am late for work, as usual. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Great job. It works fine, appreciate your help!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Centering Image
Next Topic: Re: Avoiding a FOR loop in calculation of SPH potential energy

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

Current Time: Wed Oct 08 13:37:18 PDT 2025

Total time taken to generate the page: 0.00761 seconds