[source lang="cpp"]class ROOMCLASS{ a texture a constructor that creates that texture with the directx device a destructor that releases the texture}class HOUSECLASS{ a vector of ROOMCLASS called "rooms"; constructor: { ROOMCLASS temp_room; rooms.push_back(temp_room); }// at this point I have checked and the texture in both temp_room and rooms[0] are both valid.} // at this point a ROOMCLASS destructor is called and releases that texture without issue.HOUSECLASS houses;function MAKE_A_NEW_HOUSE{ HOUSECLASS temp_house; // at this point the texture in temp_house.room[0] appears to be invalid. houses.push_back(temp_house);} // at this point a ROOMCLASS destructor is called and causes an error.[/source]
Is the problem that you can't use vector.push_back when a texture is involved?
Edited by Zerocyde, 16 October 2012 - 11:11 PM.






