brianmcd/contextify — pull request #135 by yanovich (2014-11-24 22:13:08+00:00)
Title: fix segfault in GlobalPropertyGetter() (closes #89)

GlobalPropertyGetter() is a static function. It can be invoked on
a context which has already been disposed off.

It turned out that there were two possible segfault reasons.

The most obviuos one was NULL pointer dereferencing.

However, there is no way to check whether the context is alive by
examining content of it or its sandbox. Both could look valid, but cause
segfaults in node. As a woraround, we add a self-reference which we clear
on destruction. A valid self-reference is a solid indication of a
valid context now.