mirror of https://github.com/Cysharp/UniTask
fix Forget when source is already completed and source is manualy optimized task source, does not work correctly
parent
346b1e0a6b
commit
8537ddf8a6
|
@ -561,7 +561,8 @@ namespace Cysharp.Threading.Tasks
|
||||||
UniTaskScheduler.PublishUnobservedTaskException(ex);
|
UniTaskScheduler.PublishUnobservedTaskException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
awaiter.SourceOnCompleted(state =>
|
awaiter.SourceOnCompleted(state =>
|
||||||
{
|
{
|
||||||
using (var t = (StateTuple<UniTask.Awaiter>)state)
|
using (var t = (StateTuple<UniTask.Awaiter>)state)
|
||||||
|
@ -577,6 +578,7 @@ namespace Cysharp.Threading.Tasks
|
||||||
}
|
}
|
||||||
}, StateTuple.Create(awaiter));
|
}, StateTuple.Create(awaiter));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void Forget(this UniTask task, Action<Exception> exceptionHandler, bool handleExceptionOnMainThread = true)
|
public static void Forget(this UniTask task, Action<Exception> exceptionHandler, bool handleExceptionOnMainThread = true)
|
||||||
{
|
{
|
||||||
|
@ -629,7 +631,8 @@ namespace Cysharp.Threading.Tasks
|
||||||
UniTaskScheduler.PublishUnobservedTaskException(ex);
|
UniTaskScheduler.PublishUnobservedTaskException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
awaiter.SourceOnCompleted(state =>
|
awaiter.SourceOnCompleted(state =>
|
||||||
{
|
{
|
||||||
using (var t = (StateTuple<UniTask<T>.Awaiter>)state)
|
using (var t = (StateTuple<UniTask<T>.Awaiter>)state)
|
||||||
|
@ -645,6 +648,7 @@ namespace Cysharp.Threading.Tasks
|
||||||
}
|
}
|
||||||
}, StateTuple.Create(awaiter));
|
}, StateTuple.Create(awaiter));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void Forget<T>(this UniTask<T> task, Action<Exception> exceptionHandler, bool handleExceptionOnMainThread = true)
|
public static void Forget<T>(this UniTask<T> task, Action<Exception> exceptionHandler, bool handleExceptionOnMainThread = true)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue