Skip to content

Commit

Permalink
0.2.1 remove subscription to assemblyLoadContext.Unloading event to p…
Browse files Browse the repository at this point in the history
…revent crash
  • Loading branch information
dogboydog committed Feb 14, 2024
1 parent 37e5213 commit 380faf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.2.1] 2024-02-13
* Fixed a crash that could result from an attempted workaround of the 'assembly reload failed' error

## [0.2.0] 2024-02-01

### Added
Expand Down
24 changes: 1 addition & 23 deletions addons/YarnSpinner-Godot/YarnSpinnerPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,7 @@ public override void _EnterTree()
// }
//
};

var assemblyLoadContext =
AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly());
if (assemblyLoadContext != null)
{
assemblyLoadContext.Unloading += _ =>
{
// trigger unload for what we can
AssemblyLoadContext
.GetLoadContext(typeof(Compiler).Assembly)
?.Unload();
AssemblyLoadContext
.GetLoadContext(typeof(Antlr4.Runtime.Parser).Assembly)
?.Unload();
AssemblyLoadContext
.GetLoadContext(typeof(CsvHelper.CsvParser).Assembly)
?.Unload();
AssemblyLoadContext
.GetLoadContext(typeof(Google.Protobuf.MessageParser).Assembly)
?.Unload();
};
}


#if !GODOT4_2_OR_GREATER
editorInterface = GetEditorInterface();
#endif
Expand Down

0 comments on commit 380faf6

Please sign in to comment.