mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-12 04:14:26 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user