vector desalocation error

hi everyone...i´m here again...
=)

well, i make no idea why this error is happening...
I have basically this code:

1
2
3
4
5
6
7
8
9
10
11
12
vector<char*> ListParam;

    temp->classe = indiceLexClass;
    while(v){
        c_Name_Decl* n = v->nameDeclaration;
        if(n){
            char* aux = getType(n->type);
            ListParam.push_back(aux);
        }
            v = v->next;
    }
    temp->paramMethod.swap(ListParam);


it works nicely, but when i was making a debug, in the end of the method, it calls the deconstructor of the vector, and i get a segmentation fault on this line:
86 { ::operator delete(__p); }
on the new_allocator.h
anyone knows what am i doing wrong to happen this error?

edit: well, the main problem is that the "temp" is an structure that i initializate with malloc, and this structure has a vector, and it doesnt initializate, so it happen this error...
how do i fix this?
Last edited on
Don't mix malloc and C++. Use new instead, as this will call the constructor.
!!!
stuppid one here...
¬¬
I am on this problem for 2 hours and just it solved
thx a lot man
^^
Topic archived. No new replies allowed.