Proper stack cleanup after function call