diff options
| author | Ryan Snyder <ryan@vector35.com> | 2018-05-11 15:25:12 -0400 |
|---|---|---|
| committer | Ryan Snyder <ryan@vector35.com> | 2018-05-11 15:25:12 -0400 |
| commit | 3f4a7a5d0c18bf91a4b43f574f66e516028e38c9 (patch) | |
| tree | e929f6ea4373e5f8a243c77c63b17f258f5b70b6 /python/plugin.py | |
| parent | 8275894663c905b839e62c60f804c30e47584e5b (diff) | |
Fix Python BackgroundTask wrapper
Diffstat (limited to 'python/plugin.py')
| -rw-r--r-- | python/plugin.py | 8 |
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): |
