Make extra sure cache is emptied when objects get altered.

See the (new) cachePerInstance decorator in UM/Decorators, and the accompanying CachedMemberFunction handler-class.

part of CURA-11761
This commit is contained in:
Remco Burema 2024-09-03 18:23:41 +02:00
parent f8aa923ce0
commit d0252554c4
3 changed files with 10 additions and 2 deletions

View file

@ -5,7 +5,7 @@ from typing import Any, cast, List, Optional, Dict
from PyQt6.QtCore import pyqtProperty, pyqtSignal, QObject
from UM.Application import Application
from UM.Decorators import override
from UM.Decorators import CachedMemberFunctions, override
from UM.FlameProfiler import pyqtSlot
from UM.Logger import Logger
from UM.Settings.ContainerStack import ContainerStack, InvalidContainerStackError
@ -237,6 +237,7 @@ class CuraContainerStack(ContainerStack):
:param new_value: The new value to set the property to.
"""
CachedMemberFunctions.clearInstanceCache(self)
container_index = _ContainerIndexes.UserChanges
self._containers[container_index].setProperty(key, property_name, property_value, container, set_from_cache)