On 8/4/06, Chandrashekhar kaushik <[EMAIL PROTECTED]> wrote:
Hi
I have been working getting my C++ code to be used in Python ( Basically Extending )
This is the problem i am facing rite now.
I have a function that returns a Pointer to a class in my C++ Code
It looks like this
SLSocket* SLSocket::accept( SLHostInfo& client ){
socklen_t addrlen = sizeof( struct sockaddr_in );
int new_fd = ::accept( sock_fd , ( struct sockaddr* )client.address() , &addrlen );
if( new_fd == -1 ){
sl_set_error(string("SLSocket::accept() : ") + string( sys_errlist[ errno ] ));
return NULL;
}else{
return new SLSocket( new_fd );
}
}
I have used SWIG to get the Glue code.
When i call this function ( in python ) and it eventually returns ( when it gets a connection in this case )
it crashes ! I get a SEG FAULT !
Is it some thing that cannot be done ?
Are C++ functions those return pointers a pain in Python
Help :D
--
shekhar
--
--
shekhar
-- http://mail.python.org/mailman/listinfo/python-list