Skip to content

Commit

Permalink
#1718 Updates Add/Remove example to destroy children on removal.
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Woolston <jwoolston@tenkiv.com>
  • Loading branch information
jwoolston committed Aug 30, 2016
1 parent 9f3f86b commit 0c81263
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.widget.FrameLayout;
import android.widget.ProgressBar;

import org.rajawali3d.Object3D;
import org.rajawali3d.animation.Animation;
import org.rajawali3d.animation.RotateOnAxisAnimation;
import org.rajawali3d.examples.R;
Expand Down Expand Up @@ -127,7 +128,9 @@ public void removeRandomCube() {
final int count = getCurrentScene().getNumChildren();
if (count > 0) {
final int index = random.nextInt(count);
getCurrentScene().removeChild(getCurrentScene().getChildrenCopy().get(index));
final Object3D child = getCurrentScene().getChildrenCopy().get(index);
getCurrentScene().removeChild(child);
child.destroy();
}
}
}
Expand Down

0 comments on commit 0c81263

Please sign in to comment.