someone ??<br><br><div><span class="gmail_quote">On 8/4/06, <b class="gmail_sendername">Chandrashekhar kaushik</b> <<a href="mailto:shekhar.kaushik@gmail.com">shekhar.kaushik@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi<br>I have been working getting my C++ code to be used in Python ( Basically Extending )<br>This is the problem i am facing rite now.<br><br>I have a function that returns a Pointer to a class in my C++ Code<br><br>
It looks like this
<br><br>SLSocket* SLSocket::accept( SLHostInfo& client ){<br> socklen_t addrlen = sizeof( struct sockaddr_in ); <br> int new_fd = ::accept( sock_fd , ( struct sockaddr* )client.address() , &addrlen );
<br>
if( new_fd == -1 ){<br> sl_set_error(string("SLSocket::accept() : ") + string( sys_errlist[ errno ] ));<br> return NULL;<br> }else{<br> return new SLSocket( new_fd ); <br> }
<br>}<br><br>I have used SWIG to get the Glue code.<br><br>When i call this function ( in python ) and it eventually returns ( when it gets a connection in this case ) <br>it crashes ! I get a SEG FAULT !<br><br>Is it some thing that cannot be done ?
<br>Are C++ functions those return pointers a pain in Python<br><br>Help :D<br></div><div><span class="sg"><br> <br>--<br>shekhar
</span></div></blockquote></div><br><br clear="all"><br>-- <br>--<br>shekhar