Hello,
I have a very simple command line program that creates an image with text and writes it to a png file.
It works fine, but leaks many objects as it exits. Can anyone give me insight as to what I’m doing wrong here?
Thank you!
int main (int argc, char* argv[])
{
FileOutputStream fstream ( File ("~/Desktop/test.png") );
PNGImageFormat pngWriter;
int npixelsX = 600;
int npixelsY = 200;
Image myImage (Image::ARGB, npixelsX, npixelsY, true);
Graphics g (myImage);
const Rectangle<int> area (0, 0, npixelsX, npixelsY);
g.setFont (20.0f);
g.setColour (Colours::black);
g.drawFittedText ("This program leaks objects", area, Justification::centred, 2);
pngWriter.writeImageToStream (myImage, fstream);
return 0;
}