Merge pull request #6272 from dotCooCoo/fix/plugin-remove-revision-under-lock

Plug-ins: removing a plug-in moves the revision while it holds the set
This commit is contained in:
BFlat
2026-11-09 11:47:33 +08:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+3 -1
View File
@@ -90,7 +90,9 @@ pub fn list() -> Vec<Arc<Plugin>> {
/// Uninstalls `id`; false if it wasn't installed.
pub fn remove(id: &str) -> bool {
let gone = PLUGINS.write().unwrap_or_else(|e| e.into_inner()).remove(id).is_some();
// The revision moves while the write lock is held, as in `install`.
let mut plugins = PLUGINS.write().unwrap_or_else(|e| e.into_inner());
let gone = plugins.remove(id).is_some();
if gone {
REVISION.fetch_add(1, Ordering::Relaxed);
}