src/gui/channellist.cpp: use channellist object on stack

Heap not required here.


Origin commit data
------------------
Branch: ni/coolstream
Commit: e138d8a517
Author: Thilo Graf <dbt@novatux.de>
Date: 2018-03-25 (Sun, 25 Mar 2018)



------------------
This commit was generated by Migit
This commit is contained in:
2018-03-25 15:47:15 +02:00
committed by vanhofen
parent 27bae9aa6e
commit 90a49b465a

View File

@@ -1248,8 +1248,8 @@ int CChannelList::showLiveBouquet(int key)
{ {
if (this->lastChList.size() > 1) if (this->lastChList.size() > 1)
{ {
CChannelList * liveList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HISTORY), true, true); CChannelList liveList(g_Locale->getText(LOCALE_CHANNELLIST_HISTORY), true, true);
liveList->setLiveBouquet(); liveList.setLiveBouquet();
for (unsigned int i = 1; i < this->lastChList.size(); ++i) for (unsigned int i = 1; i < this->lastChList.size(); ++i)
{ {
@@ -1258,16 +1258,15 @@ int CChannelList::showLiveBouquet(int key)
{ {
CZapitChannel* channel = getChannel(channel_id); CZapitChannel* channel = getChannel(channel_id);
if (channel) if (channel)
liveList->addChannel(channel); liveList.addChannel(channel);
} }
} }
if (!liveList->isEmpty()) if (!liveList.isEmpty())
{ {
this->frameBuffer->paintBackground(); this->frameBuffer->paintBackground();
res = liveList->exec(); res = liveList.exec();
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
} }
delete liveList;
} }
else else
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_CHANNELLIST_HISTORY_EMPTY); ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_CHANNELLIST_HISTORY_EMPTY);
@@ -1280,15 +1279,15 @@ int CChannelList::showLiveBouquet(int key)
{ {
bool isRecord = (!autoshift && CNeutrinoApp::getInstance()->recordingstatus); bool isRecord = (!autoshift && CNeutrinoApp::getInstance()->recordingstatus);
CChannelList * origList = CNeutrinoApp::getInstance()->channelList; CChannelList * origList = CNeutrinoApp::getInstance()->channelList;
CChannelList * liveList = new CChannelList(isRecord ? g_Locale->getText(LOCALE_CHANNELLIST_RECORDABLE_CHANNELS) : g_Locale->getText(LOCALE_CHANNELLIST_CURRENT_TP), false, true); CChannelList liveList(isRecord ? g_Locale->getText(LOCALE_CHANNELLIST_RECORDABLE_CHANNELS) : g_Locale->getText(LOCALE_CHANNELLIST_CURRENT_TP), false, true);
liveList->setLiveBouquet(); liveList.setLiveBouquet();
if (isRecord) if (isRecord)
{ {
for (unsigned int i = 0 ; i < (*origList->chanlist).size(); i++) for (unsigned int i = 0 ; i < (*origList->chanlist).size(); i++)
{ {
if (SameTP((*origList->chanlist)[i])) if (SameTP((*origList->chanlist)[i]))
liveList->addChannel((*origList->chanlist)[i]); liveList.addChannel((*origList->chanlist)[i]);
} }
} }
else else
@@ -1297,17 +1296,16 @@ int CChannelList::showLiveBouquet(int key)
for (unsigned int i = 0; i < (*origList->chanlist).size(); i++) for (unsigned int i = 0; i < (*origList->chanlist).size(); i++)
{ {
if (((*origList->chanlist)[i]->getChannelID() >> 16) == recid) if (((*origList->chanlist)[i]->getChannelID() >> 16) == recid)
liveList->addChannel((*origList->chanlist)[i]); liveList.addChannel((*origList->chanlist)[i]);
} }
} }
if (!liveList->isEmpty()) if (!liveList.isEmpty())
{ {
liveList->adjustToChannelID(origList->getActiveChannel_ChannelID()); liveList.adjustToChannelID(origList->getActiveChannel_ChannelID());
this->frameBuffer->paintBackground(); this->frameBuffer->paintBackground();
res = liveList->exec(); res = liveList.exec();
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
} }
delete liveList;
return res; return res;
} }