mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +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>
|
||||
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.
|
||||
// Can potentially be avoided if we have a need to do so in the future.
|
||||
if (!ThreadSafety.IsUpdateThread)
|
||||
|
Loading…
Reference in New Issue
Block a user