I have a ruby script that does a few perforce operations (through the scripting API) then simply ends:
def foo()
...
end
def bar()
...
end
foo()
bar()
puts __LINE__
exit 0
#end of file
…and while the LINE will print out, the process never ends, whether the exit(0) is there or not. This is ruby 1.8.6, primarily on the mac, but I’m seeing this on the PC as well.
I’m doing the usual google poking around, but hoped there might be a voice of experience here to bank on. Thanks.
I’m not at all familiar with perforce, but the culprit might be an
at_exitmethod that’s stuck in a loop for some reason. Observe the behavior usingirb, for instance:To confirm whether an
at_exitfunction is causing the process to hang, you can try hooking intoat_exit. Note that the#{caller}will display the stack trace of who calledat_exit:which outputs:
and never returns.