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

Home » Public Forums » archive » DLM "unload"?
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
DLM "unload"? [message #88341] Tue, 15 April 2014 14:07 Go to next message
Bill Nel is currently offline  Bill Nel
Messages: 31
Registered: October 2010
Member
from the "New free DLL for calling Python from IDL!" thread...

On Monday, March 3, 2014 12:29:01 PM UTC-7, Haje Korth wrote:
> ... found a bug: IDL 8.3 crashes when .f (.full_session_reset) is issued after the DLM is load.

>> I would bet that they forgot to register a DLM "unload" routine for .full reset. >>So the DLM is probably being unloaded, but it isn't being given the chance to >>unload any of it's data structures...
>>
>> Cheers,
>> Chris

Chris,

Can you elaborate? I don' see anything in the documentation or the example DLM code about an IDL_Unload routine. I have a handful of DLL's I use quite regularly, but IDL doesn't crash after a .full_reset. Am I just getting lucky, or is there something else I should be doing? For the DLL, I mean -- not to crash IDL. :-)

I use IDL 8.3 on a 64-bit Windows 7 system, if that makes any difference.

Thanks,
Wayne
Re: DLM "unload"? [message #88354 is a reply to message #88341] Wed, 16 April 2014 08:14 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 4/15/14, 3:07 pm, rigby@crd.ge.com wrote:
> from the "New free DLL for calling Python from IDL!" thread...
>
> On Monday, March 3, 2014 12:29:01 PM UTC-7, Haje Korth wrote:
>> ... found a bug: IDL 8.3 crashes when .f (.full_session_reset) is
>> issued after the DLM is load.
>
>>> I would bet that they forgot to register a DLM "unload" routine
>>> for .full reset. >>So the DLM is probably being unloaded, but it
>>> isn't being given the chance to >>unload any of it's data
>>> structures...
>>>
>>> Cheers, Chris
>
> Chris,
>
> Can you elaborate? I don' see anything in the documentation or the
> example DLM code about an IDL_Unload routine. I have a handful of
> DLL's I use quite regularly, but IDL doesn't crash after a
> .full_reset. Am I just getting lucky, or is there something else I
> should be doing? For the DLL, I mean -- not to crash IDL. :-)
>
> I use IDL 8.3 on a 64-bit Windows 7 system, if that makes any
> difference.
>
> Thanks, Wayne
>

See:

http://www.exelisvis.com/docs/ExitHandlers.html

Particularly the last paragraph.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
Re: DLM "unload"? [message #88356 is a reply to message #88354] Wed, 16 April 2014 12:05 Go to previous messageGo to next message
Bill Nel is currently offline  Bill Nel
Messages: 31
Registered: October 2010
Member
Thanks! That explains it -- I'm not using IDL_ExitRegister().
Re: DLM "unload"? [message #88370 is a reply to message #88356] Thu, 17 April 2014 09:56 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Wednesday, April 16, 2014 1:05:54 PM UTC-6, ri...@crd.ge.com wrote:
> Thanks! That explains it -- I'm not using IDL_ExitRegister().

You don't need to use IDL_ExitRegister if your dlm is just doing simple math operations. You only need to use it if you are doing your own memory allocations or keeping files open. If you are using all of IDL's standard memory allocation routines then that memory is owned by IDL and you don't need to worry about it.

-Chris
Re: DLM "unload"? [message #88375 is a reply to message #88370] Thu, 17 April 2014 13:21 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 4/17/14, 10:56 AM, Chris Torrence wrote:
> On Wednesday, April 16, 2014 1:05:54 PM UTC-6, ri...@crd.ge.com
> wrote:
>> Thanks! That explains it -- I'm not using IDL_ExitRegister().
>
> You don't need to use IDL_ExitRegister if your dlm is just doing
> simple math operations. You only need to use it if you are doing your
> own memory allocations or keeping files open. If you are using all of
> IDL's standard memory allocation routines then that memory is owned
> by IDL and you don't need to worry about it.
>
> -Chris
>

Right, but that explains why his was working. He wasn't getting lucky,
he did not have (or need) a exit routine that needed to be called on
resets either.

But, I think this means that I need to add a IDL_ResetSession routine
to unregister my exit routine in some of my DLMs.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Drawing the mean in cgboxplot
Next Topic: CATCH inside a FOR loop and out?

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

Current Time: Wed Oct 08 13:51:55 PDT 2025

Total time taken to generate the page: 0.00580 seconds