Re: Problem with EXIT and garbage collection [message #90940 is a reply to message #90887] |
Fri, 15 May 2015 03:41  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
Hello,
This is very odd behavior. I can confirm it happens on IDL 8.3 and 8.4 under Linux. Also, if garbage collection is disabled, with heap_refcount(), the problem does not happen.
Paulo
On Tuesday, May 5, 2015 at 6:05:44 PM UTC-3, Mike Galloy wrote:
> If I have a routine like this that uses garbage collection and does not
> explicitly free its memory:
>
> pro test
> compile_opt strictarr
>
> o = list()
> ; obj_destroy, o
>
> exit, status=1
> end
>
> And, run it from the command line like below, I get a strange error:
>
> $ idl -e test
> IDL Version 8.4, Mac OS X (darwin x86_64 m64). (c) 2014, Exelis
> Visual Information Solutions, Inc.
>
> % Compiled module: TEST.
> % Can't return from the main level.
> % Execution halted at: $MAIN$ 8
>
> If I uncomment the OBJ_DESTROY, I get what I want:
>
> $ idl -e test
> IDL Version 8.4, Mac OS X (darwin x86_64 m64). (c) 2014, Exelis
> Visual Information Solutions, Inc.
>
> % Compiled module: TEST.
> $ echo $?
> 1
>
> Mike
> --
> Michael Galloy
> www.michaelgalloy.com
> Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
|
|
|