提交 d558f08f 编写于 作者: A alteredq

Editor: deallocating removed objects and helpers.

I wonder what to do about geometries and materials used by removed objects. Seems like we would need to implement some reference counting scheme (we can't just remove deleted object subcomponents as they could be shared).
上级 7ae166f5
......@@ -446,12 +446,14 @@ var Viewport = function ( signals ) {
// remove selected object from the scene
selected.parent.remove( selected );
selected.deallocate();
// remove eventual pure Object3D targets from the scene
if ( selected.target && !selected.target.geometry ) {
selected.target.parent.remove( selected.target );
selected.target.deallocate();
}
......@@ -471,7 +473,10 @@ var Viewport = function ( signals ) {
for ( var i = 0; i < helpersToRemove.length; i ++ ) {
helpersToRemove[ i ].parent.remove( helpersToRemove[ i ] );
var helper = helpersToRemove[ i ];
helper.parent.remove( helper );
helper.deallocate();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册