summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRyan Snyder <ryan@vector35.com>2018-05-11 15:25:12 -0400
committerRyan Snyder <ryan@vector35.com>2018-05-11 15:25:12 -0400
commit3f4a7a5d0c18bf91a4b43f574f66e516028e38c9 (patch)
treee929f6ea4373e5f8a243c77c63b17f258f5b70b6 /python
parent8275894663c905b839e62c60f804c30e47584e5b (diff)
Fix Python BackgroundTask wrapper
Diffstat (limited to 'python')
-rw-r--r--python/plugin.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/plugin.py b/python/plugin.py
index c6cd9fc0..30a46412 100644
--- a/python/plugin.py
+++ b/python/plugin.py
@@ -560,8 +560,8 @@ class _BackgroundTaskMetaclass(type):
tasks = core.BNGetRunningBackgroundTasks(count)
result = []
for i in xrange(0, count.value):
- result.append(BackgroundTask(core.BNNewBackgroundTaskReference(tasks[i])))
- core.BNFreeBackgroundTaskList(tasks)
+ result.append(BackgroundTask(handle=core.BNNewBackgroundTaskReference(tasks[i])))
+ core.BNFreeBackgroundTaskList(tasks, count.value)
return result
def __iter__(self):
@@ -570,9 +570,9 @@ class _BackgroundTaskMetaclass(type):
tasks = core.BNGetRunningBackgroundTasks(count)
try:
for i in xrange(0, count.value):
- yield BackgroundTask(core.BNNewBackgroundTaskReference(tasks[i]))
+ yield BackgroundTask(handle=core.BNNewBackgroundTaskReference(tasks[i]))
finally:
- core.BNFreeBackgroundTaskList(tasks)
+ core.BNFreeBackgroundTaskList(tasks, count.value)
class BackgroundTask(object):