1 constructor, 2 destructor!
Hey everyone, I'm really stumped on this one. This is my code:
Code:
for(i = 0; i < 6; ++i)
{
fighters1.push_back(Ship(false));
fighters1[i].init(gfx, (float)i * shipSpace, 1000);
fighters2.push_back(Ship(false));
fighters2[i].init(gfx, (float)(i + 1) * shipSpace - bmpDimensions.right, 1050 + bmpDimensions.bottom);
}
fighters1 and fighters2 are "std::vector<Ship>".
Somehow, in my log file, this happens:
Ship constructor
Ship destructor
Ship constructor
Ship destructor
Ship constructor <- *!
Ship destructor
Ship destructor
Ship constructor <- *!
Ship destructor
Ship destructor
Ship constructor <- *!
Ship destructor
Ship destru-*crash*
Would the constructor/double-destructor have anything to do with using the vector::push_back()? :confused: If anybody needs to see more code, I can post it.