RLC <[EMAIL PROTECTED]> wrote: > >I am new to python SWIG. Recently I wrote a small program trying to >import collada files(using colladadom) into python so I could use >python cgkit to render them. However, during the progressing, I got >some problems. Every time I quit from Python, I get a segmentation >fault, although the main program runs well. I suspect it is because I >wrapped std::vector objects in C struct and I did not release the >memory properly.
That won't cause a segmentation fault. However, I notice that you are using "malloc" and "free" to allocate and free your objects. "stl" will use "new" and "delete", and it's not always healthy to mix them. If I were you, I'd replace this: > Vertex *v; > v = (Vertex *)malloc(sizeof(Vertex)); with this, which is less typing: Vertex * x = new Vertex; -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list