tmpvar/jsdom — pull request #871 by paton (2014-08-30 01:01:02+00:00)
Title: Wrap dispose in setTimeout to prevent segfault

I was consistently getting a segfault after creating 50-100 environments in series, but deferring the Contextify .dispose() fixed the problem.

This should fix #806.

Segfault ([full stack trace](http://pastey.org/view/raw/704fa2ca))
````
#
# Fatal error in ../deps/v8/src/api.h, line 297
# CHECK(allow_empty_handle || that != __null) failed
#
````

The underlying issue seems to be in Contextify. Possibly related: https://github.com/brianmcd/contextify/issues/89#issuecomment-24720569
> If client code to Contextify calls .dispose on a sandbox, the context will get pulled out from under it. Asynchronous operations set up within the sandbox may then fire at a later time, causing the null handle derefs.