If, however, the nested function does not refer to anything that has gone out of scope, you should be safe.