diff options
author | chriszero <zerov83@gmail.com> | 2015-02-13 16:14:10 +0100 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2015-02-13 16:14:10 +0100 |
commit | 20fefdd3f341d6e7f6b15e4926bf5569aa1943d5 (patch) | |
tree | ba402770b4912be3d93f6dd8faab521f4b5e4762 /plex.cpp | |
parent | b5c156939ddf2fc4ec3fa27ae1c3daae28681c12 (diff) | |
download | vdr-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.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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()); } } |