Skip to content

Commit 8ec475a

Browse files
eder-matheusclaude
andcommitted
gui: fix heatmap and render thread issues on database reload
Call destroyMap() in HeatMapDataSource::setChip when the chip changes to invalidate cached heatmap data. Fix the MapSettingMultiChoice getter type from const std::string to std::string to avoid std::function double-wrapping. Stop render threads in saveSettings before serializing renderer state to prevent races with the render thread on exit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
1 parent f952e35 commit 8ec475a

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/gui/include/gui/heatMap.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class HeatMapDataSource
5353
std::string name;
5454
std::string label;
5555
std::function<std::vector<std::string>()> choices;
56-
std::function<const std::string()> getter;
56+
std::function<std::string()> getter;
5757
std::function<void(const std::string&)> setter;
5858
};
5959

@@ -92,7 +92,13 @@ class HeatMapDataSource
9292

9393
void registerHeatMap();
9494

95-
virtual void setChip(odb::dbChip* chip) { chip_ = chip; }
95+
virtual void setChip(odb::dbChip* chip)
96+
{
97+
if (chip_ != chip) {
98+
destroyMap();
99+
}
100+
chip_ = chip;
101+
}
96102
void setUseDBU(bool use_dbu) { use_dbu_ = use_dbu; }
97103
bool getUseDBU() const { return use_dbu_; }
98104

src/gui/src/heatMapCore.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ Renderer::Settings HeatMapDataSource::getSettings() const
397397
settings[set.name] = set.getter();
398398
}
399399
}
400-
401400
return settings;
402401
}
403402

src/gui/src/mainWindow.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,10 @@ void MainWindow::selectHighlightConnectedBufferTrees(bool select_flag,
16291629

16301630
void MainWindow::saveSettings()
16311631
{
1632+
// Stop render threads before saving settings to avoid races
1633+
// between the render thread and the main thread.
1634+
viewers_->exit();
1635+
16321636
QSettings settings("OpenRoad Project", "openroad");
16331637
settings.beginGroup("main");
16341638
settings.setValue("geometry", saveGeometry());

0 commit comments

Comments
 (0)