map::insert causes run-time error

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?
Does the Geometry class follow the rule of three? http://en.wikipedia.org/wiki/Rule_of_three_%28C%2B%2B_programming%29
I'm sorry I misspoke. Geometry is actually just a structure with some data members I set previously in the function.
Topic archived. No new replies allowed.