Use handles to obtain entities in future callbacks
This guarantees that the spawning entity will be present and simplifies the logic for obtaining the entity. Now we can forward the results of spawned futures and streams in the same way regardless of whether what spawned them was a model or a view.
This commit is contained in:
@@ -138,7 +138,7 @@ impl BufferView {
|
||||
|
||||
let buffer_ref = buffer.as_ref(ctx);
|
||||
Self {
|
||||
handle: ctx.handle(),
|
||||
handle: ctx.handle().downgrade(),
|
||||
buffer,
|
||||
display_map,
|
||||
selections: vec![Selection {
|
||||
|
||||
@@ -275,7 +275,7 @@ impl FileFinder {
|
||||
settings.notify_view_on_change(ctx);
|
||||
|
||||
Self {
|
||||
handle: ctx.handle(),
|
||||
handle: ctx.handle().downgrade(),
|
||||
settings,
|
||||
workspace,
|
||||
query_buffer,
|
||||
|
||||
Reference in New Issue
Block a user