Help needed with C++ extension

Michael Owens owensmk at earthlink.net
Sun May 19 19:45:04 EDT 2002


I have hit a brick wall. I am a little unsure of how vtables do or don't work 
with respect to extensions. I have a Python extension class -- Session -- 
which has a member which is a pointer to a regular C++ class -- session -- 
which is derived from an abstract base class. When I instantiate Session, I 
then create a new session on the heap and assign Session's pointer to the 
returned point from new session().

The problem I have is whenever I make a call to one of session's virtual 
functions from within the module, I get a core dump. I know there is nothing 
wrong with the code itself, but rather the context in which it is running or 
compiled. It seems like the vtable it corrupted because if I make a call to a 
non-virtual function, there is no problem.

Why does the virtual function call fail from within the module, and can I do 
anything to fix it?






More information about the Python-list mailing list