mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2025-02-16 22:08:26 +00:00
Dispose container array properly
This commit is contained in:
parent
a6a5f2ac50
commit
46fe140f33
4 changed files with 33 additions and 17 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -348,29 +348,45 @@ namespace FirstPlugin
|
|||
{
|
||||
if (ContainerArray.Count > 1)
|
||||
{
|
||||
foreach (var container in ContainerArray)
|
||||
{
|
||||
foreach (var tex in container.Textures.Values)
|
||||
{
|
||||
tex.Texture.TextureData.Clear();
|
||||
tex.Texture = null;
|
||||
tex.DisposeRenderable();
|
||||
}
|
||||
|
||||
container.Textures.Clear();
|
||||
container.Nodes.Clear();
|
||||
|
||||
container.BinaryTexFile = null;
|
||||
|
||||
if (PluginRuntime.bntxContainers.Contains(container))
|
||||
PluginRuntime.bntxContainers.Remove(container);
|
||||
}
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var tex in Textures.Values)
|
||||
{
|
||||
tex.Texture.TextureData.Clear();
|
||||
tex.Texture = null;
|
||||
tex.DisposeRenderable();
|
||||
}
|
||||
|
||||
Textures.Clear();
|
||||
Nodes.Clear();
|
||||
|
||||
this.BinaryTexFile = null;
|
||||
|
||||
if (PluginRuntime.bntxContainers.Contains(this))
|
||||
PluginRuntime.bntxContainers.Remove(this);
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
foreach (var tex in Textures.Values)
|
||||
{
|
||||
tex.Texture.TextureData.Clear();
|
||||
tex.Texture = null;
|
||||
tex.DisposeRenderable();
|
||||
}
|
||||
|
||||
Textures.Clear();
|
||||
Nodes.Clear();
|
||||
|
||||
this.BinaryTexFile = null;
|
||||
|
||||
if (PluginRuntime.bntxContainers.Contains(this))
|
||||
PluginRuntime.bntxContainers.Remove(this);
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
public static byte[] CreateNewBNTX(string Name)
|
||||
|
|
Loading…
Add table
Reference in a new issue