fix: remove duplicate CMake sources, plug timer leak, debounce idle config save#10387
Open
tinezivic wants to merge 1 commit intobambulab:masterfrom
Open
fix: remove duplicate CMake sources, plug timer leak, debounce idle config save#10387tinezivic wants to merge 1 commit intobambulab:masterfrom
tinezivic wants to merge 1 commit intobambulab:masterfrom
Conversation
f076918 to
f72afbc
Compare
f72afbc to
96c8260
Compare
…onfig save F-010: Scrollbar.cpp and ScrolledWindow.cpp were listed twice in SLIC3R_GUI_SOURCES. Removed the redundant entries. F-006: Sidebar::priv::~priv() never deleted timer_sync_printer (heap-allocated via = new wxTimer()). Added Stop() + delete + null-out in the destructor. F-015: idle handler called app_config->save() on every dirty idle event. Added 5-second rate limit via debounce_elapsed() (Debounce.hpp, pure C++, no wx dependency). OnExit() flushes remaining dirty state on clean shutdown. Extracted debounce logic to src/libslic3r/Debounce.hpp with 5 Catch2 tests (7 assertions, all passed). Build verified on Linux/GCC without new warnings. Ref: bambulab#10289
96c8260 to
aba33e8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes three small independent issues from the static analysis in #10289.
F-010 — duplicate sources in
CMakeLists.txtScrollbar.cppandScrolledWindow.cppwere listed twice inSLIC3R_GUI_SOURCES. Removed the redundant entries.F-006 —
timer_sync_printerleak inSidebar::priv::~priv()timer_sync_printeris heap-allocated (= new wxTimer()) but the destructor never deleted it. AddedStop()+delete+ null-out.F-015 — unbounded
app_config->save()in idle handlerThe idle handler called
app_config->save()on every dirty idle event — on a busy loop this means a synchronous disk write at idle frequency. Added a 5-second rate limit viastd::chrono::steady_clock.OnExit()flushes any remaining dirty state so no settings are lost on clean shutdown.Tests
Extracted the rate-limit logic into
src/libslic3r/Debounce.hpp(pure C++, no wx dependency) and addedtests/libslic3r/test_debounce.cppwith 5 Catch2 scenarios covering first call, suppression, interval expiry, zero interval, and no mutation on suppressed calls.Build verified on Linux/GCC:
cmake --build build --target BambuStudio -j$(nproc)completes without new warnings or errors.Ref: #10289