SceneNode释构时清除Parent
This commit is contained in:
@@ -113,8 +113,6 @@ namespace hgl::graph
|
||||
|
||||
void Clear() override
|
||||
{
|
||||
SceneOrient::Clear();
|
||||
|
||||
SetParent(nullptr); //清除父节点
|
||||
|
||||
bounding_box.SetZero();
|
||||
@@ -122,6 +120,8 @@ namespace hgl::graph
|
||||
|
||||
child_nodes.Clear();
|
||||
component_set.Clear();
|
||||
|
||||
SceneOrient::Clear();
|
||||
}
|
||||
|
||||
const bool ChildNodeIsEmpty()const
|
||||
|
@@ -113,6 +113,8 @@ namespace hgl::graph
|
||||
|
||||
SceneNode::~SceneNode()
|
||||
{
|
||||
SetParent(nullptr);
|
||||
|
||||
for(Component *c:component_set)
|
||||
{
|
||||
c->OnDetach(this);
|
||||
|
Reference in New Issue
Block a user