mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 04:53:21 +08:00
Throw immediately if attempting to WriteAsync
after disposed
This commit is contained in:
parent
c39c99bd43
commit
83982d258d
@ -396,6 +396,9 @@ namespace osu.Game.Database
|
|||||||
/// <param name="action">The work to run.</param>
|
/// <param name="action">The work to run.</param>
|
||||||
public Task WriteAsync(Action<Realm> action)
|
public Task WriteAsync(Action<Realm> action)
|
||||||
{
|
{
|
||||||
|
if (isDisposed)
|
||||||
|
throw new ObjectDisposedException(nameof(RealmAccess));
|
||||||
|
|
||||||
// Required to ensure the write is tracked and accounted for before disposal.
|
// Required to ensure the write is tracked and accounted for before disposal.
|
||||||
// Can potentially be avoided if we have a need to do so in the future.
|
// Can potentially be avoided if we have a need to do so in the future.
|
||||||
if (!ThreadSafety.IsUpdateThread)
|
if (!ThreadSafety.IsUpdateThread)
|
||||||
|
Loading…
Reference in New Issue
Block a user