[C++-sig] Passing inherited classes back to C++
roman.yakovenko at gmail.com
Sun May 6 11:22:09 CEST 2007
On 5/6/07, Tom Brooks <tgbrooks at gmail.com> wrote:
> I run this python code:
> quad = Renderer.Quad(250, 250, 64,64)
> c = Renderer.Color()
> Renderer.AddRenderable(quad) #Removing this line makes it not crash
> AddRenderable does:
> And later that frame, this is done:
> for(std::list<Renderable*>::iterator itr =
> renderables.begin(); itr != renderables.end(); itr++)
> Renderable* renderable = *itr;
> renderable->Draw(); //It crashes here! With error "R6025: pure
> virtual function call".
> I use your Py++ code (only thing changed is it's namespace, which is now
> Renderer), along with:
> in the Renderer namespace.
> My C++ code runs just fine if I don't use anything from Python.
> There, I think that's complete.
This is not a complete example, but it allows to make a guess - memory
To prove this, try to hold a reference to "quad" variable somewhere in
Python and run the code.
C++ Python language binding
More information about the Cplusplus-sig