Assert to add / remove observer during notifying 26/310026/7
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 19 Apr 2024 09:25:16 +0000 (18:25 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Thu, 9 May 2024 00:31:34 +0000 (09:31 +0900)
commite13254f2ccf307d38e91787a43c89e3a6113a254
tree98b591d31e186a56840931661124a9b937d313d7
parent8bc657601195aa343141e79b376647a1580c887c
Assert to add / remove observer during notifying

Let we assert the cases when observer list try to be changed during notifying.

But, allow to remove observer during notifying, only for Object cases.

Until now, we just change the observer list directly, so if notifying, then
memory corruption occured.

To avoid this case, follow as ProcessorInterface did, copy the observer lists
and check whether it is valid or not, only if somebody touch original list.

Note : For BaseObject::Impl case, it is not opened
and it didn't send notify when scene on/off.
The only observer for BaseObject::Impl is WeakHandle. and OnDestroy() didnt'
send callback that timing.

Note2 : PropertyOwner case, it is also only for update-render thread for DALi.
We can control that non of callback change the observers for this thing.

So let we assume BaseObject::Impl::RemoveObserver and
PropertyOwner::RemoveObserver will not be called
during desturct object.

TODO : Should we also control Object::RemoveObserver case?
TODO : Should we remove observer copy?

Change-Id: Ia373243bdaae83613b1b91680a77b86409977028
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
16 files changed:
dali/internal/event/common/base-object-impl.cpp
dali/internal/event/common/base-object-impl.h
dali/internal/event/common/object-impl.cpp
dali/internal/event/common/object-impl.h
dali/internal/event/events/hover-event-processor.cpp
dali/internal/update/animation/scene-graph-animator.h
dali/internal/update/animation/scene-graph-constraint-base.h
dali/internal/update/common/node-resetter.h
dali/internal/update/common/property-owner.cpp
dali/internal/update/common/property-owner.h
dali/internal/update/common/property-resetter.h
dali/internal/update/common/renderer-resetter.h
dali/internal/update/manager/scene-graph-frame-callback.h
dali/internal/update/manager/scene-graph-traveler.h
dali/internal/update/render-tasks/scene-graph-render-task.cpp
dali/internal/update/render-tasks/scene-graph-render-task.h