My application has a background image, that I create programatically. When I resize my application, I create a new image every time, in the "resized()" function.
So I am doing something like this:
- Code: Select all
background = Image(Image::RGB, getWidth(), getHeight(), false);
//Fill the image with some data
class MainTab : public Component
My question is: am I allowed to do so? Every time I resize the window, a new image is craeted. But where will the Images actually be created? On the stack or on the heap?
And what happens to the "old" images? Who is keeping track of them? Am I leaking memory? Do I maybe need to delete them somehow?