summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasmin Jessich <jasmin@anw.at>2017-06-17 23:53:40 (GMT)
committerJasmin Jessich <jasmin@anw.at>2017-06-17 23:53:40 (GMT)
commit18d3b23cf039ce1d1efb2898d4a8bd812a023f11 (patch)
treec247630a63a79f4aee148a1051b9595b9e2c52c4
parent83ca399f99eb9c82eef72d5eb2c8e9a4f6f2a438 (diff)
downloadvdr-plugin-live-18d3b23cf039ce1d1efb2898d4a8bd812a023f11.tar.gz
vdr-plugin-live-18d3b23cf039ce1d1efb2898d4a8bd812a023f11.tar.bz2
Fixed a memory leak when creating a new timer
-rw-r--r--pages/edit_timer.ecpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp
index fca11f8..24bd022 100644
--- a/pages/edit_timer.ecpp
+++ b/pages/edit_timer.ecpp
@@ -127,8 +127,9 @@ cTimer* timer;
}
if (timer == 0)
{
- timer = new cTimer();
- timer->SetFlags(tfActive);
+ eventTimer.reset( new cTimer() );
+ eventTimer->SetFlags( tfActive );
+ timer = eventTimer.get();
}
if ( timer != 0 ) {
@@ -136,12 +137,11 @@ cTimer* timer;
channel = timer->Channel()->GetChannelID();
title = timer->File() ? timer->File() : "";
if ( LiveFeatures< features::epgsearch >().Recent() ) {
- vector< string > directories = StringSplit( title, '~' );
- if (directories.size() > 1)
- {
- directory = directories[0];
- title = title.substr(directory.size()+1);
- }
+ vector< string > directories = StringSplit( title, '~' );
+ if (directories.size() > 1) {
+ directory = directories[0];
+ title = title.substr(directory.size()+1);
+ }
}
// TRANSLATORS: only adjust the ordering and separators, don't translate the m's, d's and y's
date = timer->Day() ? DatePickerToC(timer->Day(), tr("mm/dd/yyyy")) : "";