diff options
-rw-r--r-- | blacklist.c | 4 | ||||
-rw-r--r-- | epgsearchext.c | 11 | ||||
-rw-r--r-- | epgsearchext.h | 4 | ||||
-rw-r--r-- | searchtimer_thread.c | 1 |
4 files changed, 9 insertions, 11 deletions
diff --git a/blacklist.c b/blacklist.c index 484b464..1ffa8a1 100644 --- a/blacklist.c +++ b/blacklist.c @@ -88,7 +88,7 @@ cBlacklist::~cBlacklist(void) { cSearchExtCat *SearchExtCat = SearchExtCats.First(); int index = 0; - while (SearchExtCat && index < (int)(sizeof(catvalues)/sizeof(char*))) + while (SearchExtCat) { free(catvalues[index]); SearchExtCat = SearchExtCats.Next(SearchExtCat); @@ -102,12 +102,10 @@ cBlacklist::~cBlacklist(void) cBlacklist& cBlacklist::operator= (const cBlacklist &Blacklist) { memcpy(this, &Blacklist, sizeof(*this)); - catvalues = (char**) malloc(SearchExtCats.Count() * sizeof(char*)); cSearchExtCat *SearchExtCat = SearchExtCats.First(); int index = 0; while (SearchExtCat) { - catvalues[index] = (char*)malloc(MaxFileName); *catvalues[index] = 0; strcpy(catvalues[index], Blacklist.catvalues[index]); SearchExtCat = SearchExtCats.Next(SearchExtCat); diff --git a/epgsearchext.c b/epgsearchext.c index 08762c0..80fa558 100644 --- a/epgsearchext.c +++ b/epgsearchext.c @@ -130,11 +130,11 @@ cSearchExt::~cSearchExt(void) { cSearchExtCat *SearchExtCat = SearchExtCats.First(); int index = 0; - while (SearchExtCat && index < (int)(sizeof(catvalues)/sizeof(char*))) + while (SearchExtCat) { - free(catvalues[index]); - SearchExtCat = SearchExtCats.Next(SearchExtCat); - index++; + free(catvalues[index]); + SearchExtCat = SearchExtCats.Next(SearchExtCat); + index++; } free(catvalues); catvalues = NULL; @@ -146,12 +146,11 @@ cSearchExt& cSearchExt::operator= (const cSearchExt &SearchExt) CopyFromTemplate(&SearchExt); ID = SearchExt.ID; strcpy(search, SearchExt.search); - catvalues = (char**) malloc(SearchExtCats.Count() * sizeof(char*)); + cSearchExtCat *SearchExtCat = SearchExtCats.First(); int index = 0; while (SearchExtCat) { - catvalues[index] = (char*)malloc(MaxFileName); *catvalues[index] = 0; strcpy(catvalues[index], SearchExt.catvalues[index]); SearchExtCat = SearchExtCats.Next(SearchExtCat); diff --git a/epgsearchext.h b/epgsearchext.h index 489deed..16a4c49 100644 --- a/epgsearchext.h +++ b/epgsearchext.h @@ -213,7 +213,7 @@ class cSearchExts : public cList<cSearchExt>, public cMutex { private: char *fileName; bool allowComments; - void Clear(void) + virtual void Clear(void) { cMutexLock SearchExtsLock(this); free(fileName); @@ -222,7 +222,7 @@ class cSearchExts : public cList<cSearchExt>, public cMutex { } public: cSearchExts(void) { fileName = NULL; } - virtual ~cSearchExts() { free(fileName); } + virtual ~cSearchExts() { Clear(); free(fileName); } public: bool Load(const char *FileName = NULL); diff --git a/searchtimer_thread.c b/searchtimer_thread.c index 4f3f3ad..b82df28 100644 --- a/searchtimer_thread.c +++ b/searchtimer_thread.c @@ -479,6 +479,7 @@ void cSearchTimerThread::Action(void) if (Summary) free(Summary); delete timer; } + delete pSearchResults; searchExt = localSearchExts->Next(searchExt); } |