From 6445b14b334eff762a3f9cd23fbd29ab9e065700 Mon Sep 17 00:00:00 2001 From: Marcel Groothuis Date: Sun, 12 Aug 2012 22:29:56 +0200 Subject: [PATCH] pvr: fixed: garbage in returned GroupName due to out-of-scope usage of a std::string This fixes the channel groups for all pvr addons under Windows. This commit partly reverts the change from 4e72ffee1177838765917cca1c663121e9319f9c --- xbmc/pvr/channels/PVRChannelGroup.cpp | 6 ++---- xbmc/pvr/channels/PVRChannelGroup.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/xbmc/pvr/channels/PVRChannelGroup.cpp b/xbmc/pvr/channels/PVRChannelGroup.cpp index c87554da584dd..f7bb2f0794e3c 100644 --- a/xbmc/pvr/channels/PVRChannelGroup.cpp +++ b/xbmc/pvr/channels/PVRChannelGroup.cpp @@ -1086,11 +1086,9 @@ int CPVRChannelGroup::GroupType(void) const return m_iGroupType; } -CStdString CPVRChannelGroup::GroupName(void) const +const CStdString& CPVRChannelGroup::GroupName(void) const { - CSingleLock lock(m_critSection); - CStdString strReturn(m_strGroupName); - return strReturn; + return m_strGroupName; } bool CPVRChannelGroup::UpdateChannel(const CFileItem &item, bool bHidden, bool bVirtual, bool bEPGEnabled, bool bParentalLocked, int iEPGSource, int iChannelNumber, const CStdString &strChannelName, const CStdString &strIconPath, const CStdString &strStreamURL) diff --git a/xbmc/pvr/channels/PVRChannelGroup.h b/xbmc/pvr/channels/PVRChannelGroup.h index 39dd50ff0bd1a..b9575e2c3fcc7 100644 --- a/xbmc/pvr/channels/PVRChannelGroup.h +++ b/xbmc/pvr/channels/PVRChannelGroup.h @@ -208,7 +208,7 @@ namespace PVR * @brief The name of this group. * @return The name of this group. */ - CStdString GroupName(void) const; + const CStdString &GroupName(void) const; /*! @name Sort methods */