Bad Advice? [message #89595] |
Thu, 30 October 2014 11:14  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
The latest article on the IDL Data Point blog contains this advice:
"Be very careful using the OBJ_DESTROY method."
I'm not sure this is particularly good advice, especially if you write
IDL code that might inadvertently be run on a non-IDL 8 version of IDL.
In those cases (and I think I would still argue in ALL cases), you might
want to be *sure* to use the OBJ_DESTROY method!
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|
Re: Bad Advice? [message #89602 is a reply to message #89595] |
Thu, 30 October 2014 16:00  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 10/30/14, 12:14 PM, David Fanning wrote:
> Folks,
>
> The latest article on the IDL Data Point blog contains this advice:
>
> "Be very careful using the OBJ_DESTROY method."
>
> I'm not sure this is particularly good advice, especially if you write
> IDL code that might inadvertently be run on a non-IDL 8 version of IDL.
> In those cases (and I think I would still argue in ALL cases), you might
> want to be *sure* to use the OBJ_DESTROY method!
Yes, I use OBJ_DESTROY as well since it's easy and doesn't make a
compatibility issue.
But the context from the article is to be careful with OBJ_DESTROY when
you have multiple references to a single heap variable. Calling
OBJ_DESTROY on one will destroy the reference of all of them.
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
|
|
|