Re: object argument passing behaviour changed in v8.2.2? [message #84593] |
Mon, 21 October 2013 16:07  |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
Hi Paul,
Nothing has changed with the way IDL passes objects. However, I'm a little confused by your code. When you say that the "compute_interpolation_frequency" procedure "allocates the resulting object", do you really mean that it just fills in some properties on that object? Because it looks like you are doing an obj_new on those objects before passing them in.
It looks like something strange is going on with garbage collection, where it is somehow freeing up your object inside compute_interpolation_frequency. However, I can't imagine why this would be happening. I just create a test program which approximates what you are doing:
pro test_pass_objelement, obj
obj->getproperty, name = name
obj->SetProperty, NAME='NewName'
end
o = objarr(5)
for i=0,4 do begin
o[i] = obj_new('IDLitComponent', NAME=STRTRIM(i,2))
test_pass_objelement, o[i]
print, obj_valid(o[i])
endfor
end
When I run this code (at least in IDL 8.3), the objects are all valid after the procedure call. Can you try running this code to make sure it passes for you? If it does, then maybe you can post the details of your compute_interpolation_frequency procedure, so we can diagnose what is happening inside
|
|
|