fix infinite recursion in reactive context
This commit is contained in:
1 parent
26378631e0
commit
26e4651e9f
2 files changed
+7
-4
No files matched your search
@@ -19,7 +19,7 @@ pub struct ReactiveContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
thread_local! {
|
thread_local! {
|
||||||
static CURRENT: RefCell<Vec<ReactiveContext>> = RefCell::new(vec![]);
|
static CURRENT: RefCell<Vec<ReactiveContext>> = const { RefCell::new(vec![]) };
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ReactiveContext {
|
impl ReactiveContext {
|
||||||
@@ -42,7 +42,10 @@ impl ReactiveContext {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut self_ = Self {
|
let mut self_ = Self {
|
||||||
inner: CopyValue::new_maybe_sync(inner),
|
inner: CopyValue::new_maybe_sync_in_scope(
|
||||||
|
inner,
|
||||||
|
scope.or_else(current_scope_id).unwrap(),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
self_.inner.write().self_ = Some(self_);
|
self_.inner.write().self_ = Some(self_);
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ fn set_owner<S: AnyStorage>(owner: Option<Owner<S>>) -> Option<Owner<S>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
thread_local! {
|
thread_local! {
|
||||||
static SYNC_OWNER: RefCell<Option<Owner<SyncStorage>>> = RefCell::new(None);
|
static SYNC_OWNER: RefCell<Option<Owner<SyncStorage>>> = const { RefCell::new(None) };
|
||||||
static UNSYNC_OWNER: RefCell<Option<Owner<UnsyncStorage>>> = RefCell::new(None);
|
static UNSYNC_OWNER: RefCell<Option<Owner<UnsyncStorage>>> = const { RefCell::new(None) };
|
||||||
}
|
}
|
||||||
|
|
||||||
fn current_owner<S: Storage<T>, T>() -> Owner<S> {
|
fn current_owner<S: Storage<T>, T>() -> Owner<S> {
|
||||||
|
|||||||
Reference in new issue
Block a user