[C++-sig] Getting base C++ class from a derived python class...
roman_sulzhyk at yahoo.com
Wed Jun 18 17:57:00 CEST 2003
Ooops, never mind guys, I thought it was the dangling pointer in the
casting of the Python class to base C++ class, but I've just realized
it was actually complaining about the next line, when it returns the
char * as the result of the testme() call, so I'm past the problem bit
and I'll be able to deal with it now.
--- Roman Sulzhyk <roman_sulzhyk at yahoo.com> wrote:
> Sorry to bother this forum, but I've been stuck at this for two days
> now and can't seem to make any progress. I'm basically trying to
> the example in tests/embedding.cpp, which works just fine for me, but
> my little program fails with dangling pointer error!
> [roman at mholden ~/src/pysymphony]$ ./smallexample
> returning service...
> Casting the service...
> Some exception caught!
> ReferenceError: Attempt to return dangling pointer to object of type:
> I'm using pyste to generate wrapper code, for the example purposes
> piled it all in one file. Also, it didn't look as ugly to begin with,
> hacked it to make it closer to the embedding example and yet it still
> doesn't work.
> One thing I can see different is that pyste generated code produces
> class_< PyService, boost::noncopyable, PyService_Wrapper
> >("PyService", init< >())
> whereas in the embedding example it's more like
> class_< PyService, PyService_Wrapper,
> init< >())
> however moving things around didn't seem to help :)
> Any insight would be greatly appreciated!
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> ATTACHMENT part 2 application/octet-stream name=smallexample.cpp
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
More information about the Cplusplus-sig