Are you at any point reassigning the pointer that is passed into the function? In other words, does your function look anything like this:
void ConsumeXMLFile(vector<DEMData>* dems)
{
// ... some code ...
dems = new vector<DEMData>();
// ...more code...
}
This is a common mistake that I see beginning C++ programmers (and C programmers) make. What is going on here is that a pointer to the dems vector is being passed by value, which means that if you modify the pointed-to vector, that will affect the the vector possessed by the caller. However if you modify the pointer (which is passed by value) this will not affect the pointer possessed by the caller. After the re-assignment, the dems pointer in ConsumeXMLFile will point to a totally different vector than the dems pointer that the caller holds.
One of the things that makes me suspect that you might be doing this is that this is C++ and there's no clear reason why you would want to pass a pointer to the vector instead of a reference to the vector otherwise.