Skip to content

Commit 446934a

Browse files
authored
Merge pull request The-OpenROAD-Project#9531 from The-OpenROAD-Project-staging/gui-mm-crash
gui: Set default scene to prevent null deref
2 parents 45cc1f6 + cdf24b3 commit 446934a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/gui/src/staGuiInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ void PathGroupSlackEndVisitor::resetWorstSlack()
976976

977977
STAGuiInterface::STAGuiInterface(sta::dbSta* sta)
978978
: sta_(sta),
979-
scene_(nullptr),
979+
scene_(sta ? sta->cmdScene() : nullptr),
980980
use_max_(true),
981981
one_path_per_endpoint_(true),
982982
max_path_count_(50),

src/gui/src/staGuiInterface.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,11 @@ class STAGuiInterface
326326
public:
327327
STAGuiInterface(sta::dbSta* sta = nullptr);
328328

329-
void setSTA(sta::dbSta* sta) { sta_ = sta; }
329+
void setSTA(sta::dbSta* sta)
330+
{
331+
sta_ = sta;
332+
scene_ = sta->cmdScene();
333+
}
330334
sta::dbSta* getSTA() const { return sta_; }
331335

332336
sta::dbNetwork* getNetwork() const { return sta_->getDbNetwork(); }

0 commit comments

Comments
 (0)