diff --git a/dom/src/dom/taitank_layout_node.cc b/dom/src/dom/taitank_layout_node.cc index a21024d6c73..0a3a9824809 100644 --- a/dom/src/dom/taitank_layout_node.cc +++ b/dom/src/dom/taitank_layout_node.cc @@ -636,7 +636,9 @@ void TaitankLayoutNode::SetPosition(Edge edge, float position) { void TaitankLayoutNode::SetScaleFactor(float sacle_factor) { assert(engine_node_ != nullptr); TaitankConfigRef config = engine_node_->GetConfig(); - config->SetScaleFactor(sacle_factor); + if (config) { + config->SetScaleFactor(sacle_factor); + } } void TaitankLayoutNode::SetMaxWidth(float max_width) { @@ -809,6 +811,7 @@ void TaitankLayoutNode::Allocate() { engine_node_ = new TaitankNode(); } void TaitankLayoutNode::Deallocate() { if (engine_node_ == nullptr) return; delete engine_node_; + engine_node_ = nullptr; } std::shared_ptr CreateLayoutNode() { return std::make_shared(); }