I am executing the following function every 25 seconds. At some point, I seem to have multiple PlaybackSessionTask tasks running at the same time. Is there a way to clean up the created tasks once they have completed? Should I reuse one task and just call start?
Code: Select all
function saveSession(titleId, seconds)
m.playbackSessionTask = createObject("roSGNode", "PlaybackSessionTask")
m.playbackSessionTask.functionName = "save"
m.playbackSessionTask.contentId = titleId
m.playbackSessionTask.seconds = seconds
m.playbackSessionTask.control = "RUN"