Hello everyone,
I have been trying to fix this error for a couple of hours now and am close to throwing my computer out the window.
I have a function with this header:
void ColladaInterface::readFile(std::map<std::string, Geometry> * geometry_map, const char* file_name)
It basically reads from a .dae file which is 3D data and puts information in a structure I named Geometry.
When I try to add this newly made geometry to my map<string, Geometry> the program crashes at run-time!
The line is:
1 2 3
|
const std::string key = new_geometry.id;
geometry_map->insert(std::map<std::string, Geometry>::value_type(key, new_geometry));
|
For more info, I create a new Geometry object, and then allocate memory for its float * field and then fill it in with floats from the file. I do the same with some integers in an int * field. As far as memory is concerned that is what this function does.
Why does it crash when I try to insert my new Geometry object into my map?