Where does tmp come from?
Quick lesson in designing a class:
In C++ when you make a class it will automatically create a some functions for you, unless you create them yourself.
Among these are the destructor, the copy constructor and the assignment operator. If you have to write any of these yourself and give them something other than their normal behaviour then it is likely you need to write all three of them.
For example, if in a constructor you create objects using new then you'll need to delete that memory in the destructor. Also you'll need to write a copy constructor and an assignment operator, otherwise you'll end up with the default behaviour. This behaviour will simply assign the value of the pointer to the other object. So you'll have two instances of your class which point to the same member data. Once one of them is destroyed and the destructor deletes the pointed to data, the other object will have a pointer which points to invalid data. When its destructor gets called... BOOM!
In your code
void pss4_model::CopyModel(pss4_model m)
you are passing 'm' by value. This means the copy constructor is used to create the local variable in the function CopyModel. If the copy constructor isn't written correctly then you'll have all sorts of problems. If you pass it by reference it won't be an issue.
I'm guessing the copy constructor is the problem for you here.
edit: fixed typo
[Edited by - petewood on October 13, 2004 10:13:33 AM]