Skip to content

Commit 5bc5775

Browse files
committed
Removed existing docking nodes when closing and resetting a session. Fixes #934.
1 parent 6f336ba commit 5bc5775

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

release-notes/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ We try to maintain compatibility with older versions of ngscopeclient but occasi
2727
* Filters: FFT waveforms were shifted one bin to the right of the correct position
2828
* Filters: Frequency and period measurement had a rounding error during integer-to-floating-point conversion causing half a cycle of the waveform to be dropped under some circumstances leading to an incorrect result, with worse error at low frequencies and short memory depths. This only affected the "summary" output not the trend plot.
2929
* GUI: Pressing middle mouse on the Y axis to autoscale would fail, setting the full scale range to zero volts, if the waveform was resident in GPU memory and the CPU-side copy of the buffer was stale
30+
* GUI: Crash when closing a session (https://github.com/ngscopeclient/scopehal-apps/issues/934)
3031

3132
## Other changes since v0.1.1
3233

src/ngscopeclient/MainWindow.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,9 @@ void MainWindow::DockingArea()
13151315
{
13161316
LogTrace("Docking initial workspace\n");
13171317

1318+
//Undock anything that might already be there
1319+
ImGui::DockBuilderRemoveNodeChildNodes(topNode->ID);
1320+
13181321
//Split the top into two sub nodes (unless imgui already did it for us during a session reset)
13191322
ImGuiID leftPanelID;
13201323
ImGuiID rightPanelID;
@@ -1329,10 +1332,10 @@ void MainWindow::DockingArea()
13291332
ImGui::DockBuilderDockWindow(m_streamBrowser->GetTitleAndID().c_str(), leftPanelID);
13301333
ImGui::DockBuilderDockWindow(m_initialWorkspaceDockRequest->GetTitleAndID().c_str(), rightPanelID);
13311334

1332-
m_initialWorkspaceDockRequest = nullptr;
1333-
13341335
//Finish up
13351336
ImGui::DockBuilderFinish(dockspace_id);
1337+
1338+
m_initialWorkspaceDockRequest = nullptr;
13361339
}
13371340
}
13381341
else

0 commit comments

Comments
 (0)