mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:49:05 +02:00
use weak_ptr for fade-out-finished lambda
This commit is contained in:
parent
87d7a0a72f
commit
1ea0dba083
1 changed files with 8 additions and 4 deletions
|
@ -1066,10 +1066,14 @@ void EntityTreeRenderer::fadeOutRenderable(const EntityRendererPointer& renderab
|
||||||
render::Transaction transaction;
|
render::Transaction transaction;
|
||||||
auto scene = _viewState->getMain3DScene();
|
auto scene = _viewState->getMain3DScene();
|
||||||
|
|
||||||
transaction.setTransitionFinishedOperator(renderable->getRenderItemID(), [scene, renderable]() {
|
EntityRendererWeakPointer weakRenderable = renderable;
|
||||||
render::Transaction transaction;
|
transaction.setTransitionFinishedOperator(renderable->getRenderItemID(), [scene, weakRenderable]() {
|
||||||
renderable->removeFromScene(scene, transaction);
|
auto renderable = weakRenderable.lock();
|
||||||
scene->enqueueTransaction(transaction);
|
if (renderable) {
|
||||||
|
render::Transaction transaction;
|
||||||
|
renderable->removeFromScene(scene, transaction);
|
||||||
|
scene->enqueueTransaction(transaction);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
scene->enqueueTransaction(transaction);
|
scene->enqueueTransaction(transaction);
|
||||||
|
|
Loading…
Reference in a new issue