mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Merge pull request #65 from ff-meli/plugin_dispose_fix
fix race condition with plugin render vs dispose, on Dalamud dispose
This commit is contained in:
commit
4d18a063f7
1 changed files with 6 additions and 2 deletions
|
|
@ -135,6 +135,12 @@ namespace Dalamud {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
|
// this must be done before unloading plugins, or it can cause a race condition
|
||||||
|
// due to rendering happening on another thread, where a plugin might receive
|
||||||
|
// a render call after it has been disposed, which can crash if it attempts to
|
||||||
|
// use any resources that it freed in its own Dispose method
|
||||||
|
this.InterfaceManager.Dispose();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.PluginManager.UnloadPlugins();
|
this.PluginManager.UnloadPlugins();
|
||||||
|
|
@ -146,8 +152,6 @@ namespace Dalamud {
|
||||||
Log.Error(ex, "Plugin unload failed.");
|
Log.Error(ex, "Plugin unload failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.InterfaceManager.Dispose();
|
|
||||||
|
|
||||||
this.Framework.Dispose();
|
this.Framework.Dispose();
|
||||||
this.ClientState.Dispose();
|
this.ClientState.Dispose();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue