summaryrefslogtreecommitdiff
path: root/dxr3osd.c
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2009-10-13 12:58:53 +0200
committerChristian Gmeiner <christian.gmeiner@gmail.com>2009-10-13 12:58:53 +0200
commitc88a9d875cb30a7bd30257fdc5de5f4ac88a3f8b (patch)
tree0a6811e8e34742033e8067425e3e0979ce7fcfd7 /dxr3osd.c
parent8435197ec3e9b338936186a40e78f5f2364bb9ee (diff)
downloadvdr-plugin-dxr3-c88a9d875cb30a7bd30257fdc5de5f4ac88a3f8b.tar.gz
vdr-plugin-dxr3-c88a9d875cb30a7bd30257fdc5de5f4ac88a3f8b.tar.bz2
dont leak memory
Diffstat (limited to 'dxr3osd.c')
-rw-r--r--dxr3osd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dxr3osd.c b/dxr3osd.c
index 64a2460..9a20ef1 100644
--- a/dxr3osd.c
+++ b/dxr3osd.c
@@ -235,6 +235,7 @@ void cDxr3Osd::Flush()
int top = Top();
int left = Left();
+ bool scaling = false;
// check if we need to scale the osd
if (horizontal < 720 || vertical < 576) {
@@ -258,6 +259,7 @@ void cDxr3Osd::Flush()
cBitmap *scaled = cScaler::scaleBitmap(bmap, width, height);
scaled->Replace(*Palette);
+ scaling = true;
bmap = scaled;
}
@@ -268,6 +270,12 @@ void cDxr3Osd::Flush()
bmap->Clean();
}
+ // check if we need to free the bitmap allocated by the method
+ // cScaler::scaleBitmap
+ if (scaling) {
+ delete bmap;
+ }
+
#if 0
if (last->Elapsed() < cDxr3ConfigData::instance()->GetOsdFlushRate())
return;