diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-05-14 12:18:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-05-14 12:25:29 +0300 |
commit | 3c09beb3b1f785c920eed3d61f7c2a2a06deba50 (patch) | |
tree | d0b3493390134ddc0a9a0ad92f3e3131a4865f07 /tests | |
parent | fce795415ade673dfbe4b176113c09a925150c71 (diff) |
Fix memory leak in IDPropertyGroup.pop()
When popping ID-property groups/arrays,
ID-property was removed but not freed.
Now the value is converted to a native Python type and freed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/python/bl_pyapi_idprop.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/python/bl_pyapi_idprop.py b/tests/python/bl_pyapi_idprop.py index 3d0cbd2a7bb..7b480f5fa16 100644 --- a/tests/python/bl_pyapi_idprop.py +++ b/tests/python/bl_pyapi_idprop.py @@ -15,12 +15,12 @@ class TestHelper: def setUp(self): self._id = bpy.context.scene - assert(len(self._id.keys()) == 0 or self._id.keys() == ["cycles"]) + self._id.pop("cycles", None) + assert(len(self._id.keys()) == 0) def tearDown(self): for key in list(self._id.keys()): - if key != "cycles": - del self._id[key] + del self._id[key] def assertAlmostEqualSeq(self, list1, list2): self.assertEqual(len(list1), len(list2)) |