From 184e254b2df8eda05e6dc9765d63e4ae90446c06 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sun, 20 Feb 2011 23:01:40 +0100 Subject: another fix for cloning timers --- conflictcheck.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/conflictcheck.c b/conflictcheck.c index ac09937..e6f7120 100644 --- a/conflictcheck.c +++ b/conflictcheck.c @@ -46,7 +46,7 @@ cConflictCheckTimerObj::cConflictCheckTimerObj(cTimer* Timer, time_t Start, time cConflictCheckTimerObj::~cConflictCheckTimerObj() { // conflict checks works on a copy of a timer, so delete it again - delete timer; + DELETENULL(timer); } int cConflictCheckTimerObj::Compare(const cListObject &ListObject) const @@ -293,8 +293,7 @@ cList* cConflictCheck::CreateCurrentTimerList() } // create a copy of this timer - cTimer* clone = new cTimer; - *clone = *ti; + cTimer* clone = new cTimer(*ti); clone->SetEvent(ti->Event()); cConflictCheckTimerObj* timerObj = new cConflictCheckTimerObj(ti, Start, Start + ti->StopTime() - ti->StartTime(), deviceNr, ti->Index()); -- cgit v1.2.3