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> {
};
let InProgressState::InProgress(box InProgressStateInner {
done_event,
once_task: _,
once_task,
stale,
session_dependent,
done: _,
......@@ -2138,6 +2138,15 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
task.shrink_to_fit(CachedDataItemType::CollectiblesDependency);
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
}
......
......@@ -595,7 +595,11 @@ impl<B: Backend + 'static> TurboTasks<B> {
)
.await?;
Ok(rx.await?)
let result = rx.await?;
self.dispose_root_task(task_id);
Ok(result)
}
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