I have a following member function prototype.
If NULL is passed to the above function it returns the size of the output array;Code:Dtk_Int32 ConvertToGeom(Geometric_set_select_entity **res = NULL) const;
I tried the following sets of code but I am getting stack corruption around the "entity" variable in each case when the function returns. If I remove the code altogether then there is no corruption and everything works fine.
Set 1:
Aussuming that I don't have to do the allocation and the function will:Code:Dtk_Int32 size = pLeaderPointer->ConvertToGeom(NULL);
Geometric_set_select_entity *entity = new Geometric_set_select_entity[size];
pLeaderPointer->ConvertToGeom(&entity);
Set 2:
The corruption again happens.Code:Geometric_set_select_entity *entity = NULL;
Dtk_Int32 size = pLeaderPointer->ConvertToGeom(&entity);
So I am in a doubt whether I am doing something wrong or the "ConvertToGeom" function is itself buggy.
Please help.
