DLM "unload"? [message #88341] |
Tue, 15 April 2014 14:07  |
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   |
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 #88375 is a reply to message #88370] |
Thu, 17 April 2014 13:21  |
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
|
|
|