-
Fixes e.g. crashs when dropping from finder. Turn the "getting_events" boolean into a counter to handle poll_func() being called recursively, and track the loop depth correctly by changing its counter before bailing out in run_loop_observer_callback(). This way we reallocate our autorelease pool at the right time, and don't kill memory that is still in use by outer run loops. Also drain, not release the pool, just for some defensive forward compatibility. (cherry picked from commit ef9a92d2)
d1c6bcb8