lwille/node-gphoto2 — Issue #7: GPhoto2 object gets garbage collected
Author: lwille
Created: 2012-01-18 00:20:03+00:00
State: open
Labels: Bug

Despite of having a ``v8::Persistent``reference in the GPCamera object, the GPhoto2 object gets garbage collected when the camera object is contained in a closure:

```javascript
gphoto.list(function(cameras) {
server = http.createServer(function(req, res){
camera.getPreview(function(er, data){
res.writeHead(200, {'Content-Type': 'image/jpeg', 'Content-Length':data.length});
res.write(data);
}})
```