NodePath subclassing

The trouble is that np.setPythonTag(‘tag’, np) causes a reference count leak: you have just added a pointer to np to itself. This means that np will never be destructed by Python, unless you break the cyclical reference explicitly when you are done with np.

So, this means that it’s a bad idea to set these cycles up automatically. There might be a better way to automatically re-Pythonize these derived objects, but it would be complicated.

For reasons like this, I’m a big fan of not subclassing NodePath. I think it was a design mistake when we made Actor do this.

David