preillyme/v8js — pull request #14 by stesie (2013-06-07 23:54:17+00:00)
Title: Memory leak in php_v8js_v8_get_properties

Hi there,

in `php_v8js_v8_get_properties` `v8::Context::New` is called, which allocates a new _permanent_ context, and the result is assigned to `temp_context` variable. However the variable is neither used anywhere nor is it disposed at the end. Hence the permanent context is leaked.

Small example to reproduce:

```
ini_set("v8js.flags", "--trace_gc");
$v8 = new V8Js();

class Failer {
function call($a) {
print_r($a, true);
}
}

$v8->failer = new Failer();
$v8->executeString('
for(;;) {
PHP.failer.call({ foo: 23 });
}
');
```

cheers,
stesie