summaryrefslogtreecommitdiff
path: root/plex.cpp
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-02-13 16:14:10 +0100
committerchriszero <zerov83@gmail.com>2015-02-13 16:14:10 +0100
commit20fefdd3f341d6e7f6b15e4926bf5569aa1943d5 (patch)
treeba402770b4912be3d93f6dd8faab521f4b5e4762 /plex.cpp
parentb5c156939ddf2fc4ec3fa27ae1c3daae28681c12 (diff)
downloadvdr-plugin-plex-20fefdd3f341d6e7f6b15e4926bf5569aa1943d5.tar.gz
vdr-plugin-plex-20fefdd3f341d6e7f6b15e4926bf5569aa1943d5.tar.bz2
Removed some raw pointers to avoid a possible memoryleak
Diffstat (limited to 'plex.cpp')
-rw-r--r--plex.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/plex.cpp b/plex.cpp
index 05a8b4e..524fd22 100644
--- a/plex.cpp
+++ b/plex.cpp
@@ -15,10 +15,10 @@ static const char *MAINMENUENTRY = "Plex for VDR";
**
** @param filename path and file name
*/
-static void PlayFile(plexclient::Video* pVid)
+static void PlayFile(plexclient::Video Vid)
{
- isyslog("[plex]: play file '%s'\n", pVid->m_sKey.c_str());
- cControl* control = cHlsPlayerControl::Create(pVid);
+ isyslog("[plex]: play file '%s'\n", Vid.m_sKey.c_str());
+ cControl* control = cHlsPlayerControl::Create(Vid);
if(control) {
cControl::Launch(control);
}
@@ -142,8 +142,7 @@ eOSState cPlexBrowser::ProcessSelected()
if(item->IsVideo()) {
- plexclient::Video* pVid = item->GetAttachedVideo();
- PlayFile(pVid);
+ PlayFile(*item->GetAttachedVideo());
return osEnd;
}
@@ -329,8 +328,7 @@ void cMyPlugin::MainThreadHook(void)
// dsyslog("[plex]%s:\n", __FUNCTION__);
// Start Tasks, e.g. Play Video
if(plexclient::ActionManager::GetInstance().IsAction()) {
- plexclient::Video* video = plexclient::ActionManager::GetInstance().GetAction();
- PlayFile(video);
+ PlayFile(plexclient::ActionManager::GetInstance().GetAction());
}
}