Fix orphaned Patch Manager search on ListModel destruction - #278
Open
kartun83 wants to merge 1 commit into
Open
Conversation
ListModel had no destructor, so a search still in flight when the panel/document is torn down (e.g. closed mid-search) never called cancelSearch() - its handle stayed registered in DB::m_searches forever and the background job kept running, the same class of bug as the already-fixed Patch Manager search leak, just on a different teardown path. Adds patchDbTest, a standalone console test (mirroring midiLearnTest) that verifies DB::cancelSearch() actually removes a handle, that an uncancelled handle stays registered indefinitely (demonstrating the leak this guards against), and that a ListModel-like RAII owner cancels its search on destruction.
kartun83
force-pushed
the
fix/patchmanager-listmodel-destroy-search-leak
branch
from
July 5, 2026 23:35
3d3476b to
5df56a5
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.
Summary
ListModelhad no destructor, so a search still in flight when the patch manager panel/document is torn down (e.g. closed mid-search) never calledcancelSearch()- its handle stayed registered inDB::m_searchesforever and the background search job kept running, the same class of bug as the already-fixed Patch Manager search leak, just on a different teardown path.~ListModel()that calls the existingcancelSearch().Test plan
patchDbTest, a standalone console test (mirrorsmidiLearnTest) verifying:DB::cancelSearch()removes a handle fromDB::m_searches; an uncancelled handle stays registered indefinitely (demonstrating the leak this guards against); aListModel-like RAII owner cancels its search on destruction.patchDbTestbuilt and run locally, all assertions pass.jucePluginEditorLibbuilds clean with the destructor added.