Fixed small memory leaks

This commit is contained in:
Michaël Lemaire 2015-08-23 22:44:45 +02:00
parent 7c7b6043c5
commit d6233c70f0
2 changed files with 6 additions and 3 deletions

View file

@ -5,8 +5,8 @@ OpenGLView {
id: main_ui id: main_ui
state: "Init" state: "Init"
width: 800 width: 1000
height: 600 height: 700
Tooltip { Tooltip {
id: tooltip_widget id: tooltip_widget

View file

@ -23,6 +23,7 @@ CanvasPictureWriter::CanvasPictureWriter(const Canvas *canvas):
CanvasPictureWriter::~CanvasPictureWriter() CanvasPictureWriter::~CanvasPictureWriter()
{ {
delete profile; delete profile;
delete[] cache;
} }
void CanvasPictureWriter::setAntialias(int antialias) void CanvasPictureWriter::setAntialias(int antialias)
@ -84,7 +85,7 @@ Color CanvasPictureWriter::getRawPixel(int x, int y)
if (not (y >= cache_y && y < cache_y + antialias)) if (not (y >= cache_y && y < cache_y + antialias))
{ {
// Load rows into cache // Load rows into cache
delete [] cache; delete[] cache;
cache_y = y; cache_y = y;
cache_width = canvas->getWidth(); cache_width = canvas->getWidth();
cache = new Color[cache_width * antialias]; cache = new Color[cache_width * antialias];
@ -117,6 +118,8 @@ Color CanvasPictureWriter::getRawPixel(int x, int y)
itcolor++; itcolor++;
} }
} }
delete stream;
} }
// Hit the cache // Hit the cache