rootpy/rootpy — pull request #299 by pwaller (2013-06-03 15:50:33+00:00)
Title: x = File.Get('x') keeps File alive as long as 'x' is alive (+ test)

@suvayu @ndawe

The following code will now work without crashing, and the objects
should have "correct" lifetimes (the file will remain open as long
as the canvas with `hist` drawn on it is around).

```python
file.Get("hist").Draw()
```

Ready for merging from my side.

Please review carefully since it was hacked together rapidly and
may have nasty implications that I've not thought of.

It happens to work as is, without needing to modify any of the
existing ownership semantics. The only difference is that when
you `Get` something from a file, the file will be kept around as
long as the thing taken from the file is around.

I believe this is safe against double-deletes, since ROOT is still
the one responsible for deleting the object. The only change is that
the file now won't be garbage collected prematurely.