From 76524cae6b1bdcc100a0ce75f39ef41c73cab45b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 25 Mar 2018 22:48:12 +0200 Subject: [PATCH] supplement to a04e899d44ad94c0f280183e254d264ce7e6c882 , memcpy don't work ok with std::string Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6264abf5426abfa09f44e81bebf08a5151848c73 Author: Jacek Jendrzej Date: 2018-03-25 (Sun, 25 Mar 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 0cd4c93bb..493841e82 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -143,6 +143,8 @@ CInfoViewer::CInfoViewer () CInfoViewer::~CInfoViewer() { ResetModules(); + if(timescale) + delete timescale; } void CInfoViewer::Init() @@ -1656,6 +1658,16 @@ void CInfoViewer::sendNoEpg(const t_channel_id for_channel_id) } } +void copy_info(CSectionsdClient::CurrentNextInfo _info, CSectionsdClient::CurrentNextInfo _oldinfo) +{ + _oldinfo.current_uniqueKey = _info.current_uniqueKey; + _oldinfo.current_name = _info.current_name; + _oldinfo.current_fsk = _info.current_fsk; + _oldinfo.next_uniqueKey = _info.next_uniqueKey; + _oldinfo.next_name = _info.next_name; + _oldinfo.flags = _info.flags; +} + void CInfoViewer::getEPG(const t_channel_id for_channel_id, CSectionsdClient::CurrentNextInfo &info) { /* to clear the oldinfo for channels without epg, call getEPG() with for_channel_id = 0 */ @@ -1669,7 +1681,7 @@ void CInfoViewer::getEPG(const t_channel_id for_channel_id, CSectionsdClient::Cu /* of there is no EPG, send an event so that parental lock can work */ if (info.current_uniqueKey == 0 && info.next_uniqueKey == 0) { - memcpy(&oldinfo, &info, sizeof(CSectionsdClient::CurrentNextInfo)); + copy_info(info,oldinfo); sendNoEpg(for_channel_id); return; } @@ -1689,7 +1701,7 @@ void CInfoViewer::getEPG(const t_channel_id for_channel_id, CSectionsdClient::Cu else msg = NeutrinoMessages::EVT_NOEPG_YET; g_RCInput->postMsg(msg, (const neutrino_msg_data_t)p, false); // data is pointer to allocated memory - memcpy(&oldinfo, &info, sizeof(CSectionsdClient::CurrentNextInfo)); + copy_info(info,oldinfo); } }