third time try to fix reloadchannels segfault with alternate_logos

This commit is contained in:
Jacek Jendrzej
2021-10-19 12:09:43 +02:00
parent f31602f91c
commit cf8c0acb30
3 changed files with 3 additions and 2 deletions

View File

@@ -192,6 +192,7 @@ public:
void SetChannelList(ZapitChannelList* zlist); void SetChannelList(ZapitChannelList* zlist);
void addChannel(CZapitChannel* chan); void addChannel(CZapitChannel* chan);
void ClearChannelList(){if (!(*chanlist).empty()) (*chanlist).clear();};
CZapitChannel* getChannel(int number); CZapitChannel* getChannel(int number);
CZapitChannel* getChannel(t_channel_id channel_id); CZapitChannel* getChannel(t_channel_id channel_id);

View File

@@ -1127,7 +1127,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
CZapitChannel * cc = NULL; CZapitChannel * cc = NULL;
if (channel->getChannelID() & 0xFFFFFFFFFFFFULL) if (channel->getChannelID() & 0xFFFFFFFFFFFFULL)
if (CNeutrinoApp::getInstance()->channelList) if (CNeutrinoApp::getInstance()->channelList)
cc = CNeutrinoApp::getInstance()->channelList->getChannel(channel->getChannelID()); cc = CServiceManager::getInstance()->FindChannel(channel->getChannelID());
if (cc) if (cc)
{ {

View File

@@ -1503,7 +1503,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_REINIT_CHANNELS: { case CZapitMessages::CMD_REINIT_CHANNELS: {
// Houdini: save actual channel to restore it later, old version's channel was set to scans.conf initial channel // Houdini: save actual channel to restore it later, old version's channel was set to scans.conf initial channel
t_channel_id cid= current_channel ? current_channel->getChannelID() : 0; t_channel_id cid= current_channel ? current_channel->getChannelID() : 0;
CNeutrinoApp::getInstance()->channelList->ClearChannelList();
PrepareChannels(); PrepareChannels();
current_channel = CServiceManager::getInstance()->FindChannel(cid); current_channel = CServiceManager::getInstance()->FindChannel(cid);