summaryrefslogtreecommitdiff
path: root/plugingui/pixelbuffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/pixelbuffer.cc')
-rw-r--r--plugingui/pixelbuffer.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugingui/pixelbuffer.cc b/plugingui/pixelbuffer.cc
index 906e4d6..5d032b4 100644
--- a/plugingui/pixelbuffer.cc
+++ b/plugingui/pixelbuffer.cc
@@ -69,7 +69,8 @@ void PixelBuffer::setPixel(size_t x, size_t y,
}
PixelBufferAlpha::PixelBufferAlpha(size_t width, size_t height)
- : buf(nullptr)
+ : managed(true)
+ , buf(nullptr)
, x(0)
, y(0)
{
@@ -78,7 +79,10 @@ PixelBufferAlpha::PixelBufferAlpha(size_t width, size_t height)
PixelBufferAlpha::~PixelBufferAlpha()
{
- free(buf);
+ if(managed)
+ {
+ free(buf);
+ }
}
void PixelBufferAlpha::realloc(size_t width, size_t height)