@AlexAUT
Well, I basically already said everything of importance;
i have the class planet_system:
class planet_system
{
public:
planet_system(int intype, sf::Texture & texture_asteroid);
void Render(sf::RenderWindow &window, sf::RenderTexture & rtex, int centerviewx, int centerviewy, sf::Vector2f viewsize, sf::Texture tex);
void RenderParalax(sf::RenderWindow &window, sf::RenderTexture & rtex, int centerviewx, int centerviewy);
void Update();
void UpdatePriceMarket();
std::vector <cplanet> vecplanets;
int anzahl_planets;
std::vector <casteroidfield> vecasteroidfields;
sf::Texture tex_back;
sf::Sprite spr_back;
sf::Texture tex_paralax1;
sf::Sprite spr_paralax1;
sf::Texture tex_paralax2;
sf::Sprite spr_paralax2;
float sizex;
float sizey;
int type;
int id;
std::string string_name;
};
and have this in the delceration of main:
std::vector <planet_system> vecplanetsystems;
and in the game loop i have this when the new level is loaded:
// Either this
vecplanetsystems = std::vector <planet_system> ();
//or this ( but both dont work)
vecplanetsystems.clear();
vecplanetsystems.shrink_to_fit();
planet_system newsystem1(system_crnt, texmngr.getRef("asteroid1"));
vecplanetsystems.push_back(newsystem1);
And the Memory just won't be freed.
(!) But even when I just have a simple main with a vector of integers, fill and clear it, it is the same problem.