Skip to content

System.ObjectDisposedException: The semaphore has been disposed #29

@sunnamed434

Description

@sunnamed434

The problem is I use the hot reload in my project, and after the reloading of the project I re-create all instances of that I use, such as LiteDB, etc

simple Repro:

// On hot-reload load
protected override void Load()
{
    _liteDatabase = new LiteDatabaseAsync(databaseFilePath);
}
// On hot-reload unload
protected override void Unload()
{
    Instance = null;
    _liteDatabase?.Dispose();
}
// and at some runtime method if I'll try to use the _liteDatabase after the "reload" - I will get an exception about dispose

Expected behavior allows me to use the lite database when the new instance is created even if the previous instance was disposed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions