mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 05:00:16 +00:00
Notify global observers when removing a global
This commit is contained in:
parent
8f1633e798
commit
1e755aa00f
1 changed files with 1 additions and 0 deletions
|
@ -843,6 +843,7 @@ impl AppContext {
|
||||||
/// Remove the global of the given type from the app context. Does not notify global observers.
|
/// Remove the global of the given type from the app context. Does not notify global observers.
|
||||||
pub fn remove_global<G: Any>(&mut self) -> G {
|
pub fn remove_global<G: Any>(&mut self) -> G {
|
||||||
let global_type = TypeId::of::<G>();
|
let global_type = TypeId::of::<G>();
|
||||||
|
self.push_effect(Effect::NotifyGlobalObservers { global_type });
|
||||||
*self
|
*self
|
||||||
.globals_by_type
|
.globals_by_type
|
||||||
.remove(&global_type)
|
.remove(&global_type)
|
||||||
|
|
Loading…
Reference in a new issue