Skip to content

Commit 4b2c15e

Browse files
committed
Tweak to model invalidation and test for buffer caches being cleared
1 parent 4a2ab9f commit 4b2c15e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/flitter/render/window/models.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ cdef class Model:
146146
for cache in self.buffer_caches:
147147
if self.name in cache:
148148
del cache[self.name]
149+
self.buffer_caches = None
149150

150151
cpdef object get_trimesh(self):
151152
self.cache_timestamp = perf_counter()

tests/test_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,5 @@ def test_box_get_buffers(self):
509509
index_data = glctx.buffer.mock_calls[1].args[0]
510510
self.assertEqual(index_data.dtype.name, 'int32')
511511
self.assertEqual(index_data.shape, (12, 3))
512+
model.invalidate()
513+
self.assertNotIn(model.name, objects)

0 commit comments

Comments
 (0)