Commit 560e14d8 authored by Tim Neutkens's avatar Tim Neutkens

Add AI suggested fix

parent a27fd1e1
...@@ -2022,7 +2022,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> { ...@@ -2022,7 +2022,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
}; };
let InProgressState::InProgress(box InProgressStateInner { let InProgressState::InProgress(box InProgressStateInner {
done_event, done_event,
once_task: _, once_task,
stale, stale,
session_dependent, session_dependent,
done: _, done: _,
...@@ -2138,6 +2138,15 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> { ...@@ -2138,6 +2138,15 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
task.shrink_to_fit(CachedDataItemType::CollectiblesDependency); task.shrink_to_fit(CachedDataItemType::CollectiblesDependency);
drop(task); drop(task);
// ✅ ADD: Remove Once tasks from transient_tasks after completion
if once_task && !stale {
self.transient_tasks.remove(&task_id);
// CRITICAL: Return the task ID to the factory for reuse
unsafe {
self.transient_task_id_factory.reuse(task_id);
}
}
false false
} }
......
...@@ -595,7 +595,11 @@ impl<B: Backend + 'static> TurboTasks<B> { ...@@ -595,7 +595,11 @@ impl<B: Backend + 'static> TurboTasks<B> {
) )
.await?; .await?;
Ok(rx.await?) let result = rx.await?;
self.dispose_root_task(task_id);
Ok(result)
} }
pub(crate) fn native_call( pub(crate) fn native_call(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment