summaryrefslogtreecommitdiff
path: root/plugingui/pixelbuffer.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-23 22:16:08 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-23 22:16:08 +0200
commit89a909599b8e9747717419ebbda5796471aada27 (patch)
tree23d5f473d50a32c68cc643d0c3c2ea13ae5a1dcb /plugingui/pixelbuffer.cc
parentd52edef797460922abbe25cd36f04a3086d0267d (diff)
Fix memory leak.
Diffstat (limited to 'plugingui/pixelbuffer.cc')
-rw-r--r--plugingui/pixelbuffer.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugingui/pixelbuffer.cc b/plugingui/pixelbuffer.cc
index a593f9e..e58658b 100644
--- a/plugingui/pixelbuffer.cc
+++ b/plugingui/pixelbuffer.cc
@@ -34,6 +34,11 @@ GUI::PixelBuffer::PixelBuffer(size_t width, size_t height)
realloc(width, height);
}
+GUI::PixelBuffer::~PixelBuffer()
+{
+ if(buf) free(buf);
+}
+
void GUI::PixelBuffer::realloc(size_t width, size_t height)
{
if(buf) free(buf);
@@ -79,6 +84,11 @@ GUI::PixelBufferAlpha::PixelBufferAlpha(size_t width, size_t height)
realloc(width, height);
}
+GUI::PixelBufferAlpha::~PixelBufferAlpha()
+{
+ if(buf) free(buf);
+}
+
void GUI::PixelBufferAlpha::realloc(size_t width, size_t height)
{
if(buf) free(buf);