From 1cfba9a8f90e41c4503f9e025d6b6b045519be44 Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 4 Oct 2022 14:46:14 -0400 Subject: [PATCH] Fixed AudioEditor crash and removed unused function --- PCK-Studio/Classes/FileTypes/Bink.cs | 1 - PCK-Studio/Forms/Editor/AudioEditor.cs | 18 ++---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/PCK-Studio/Classes/FileTypes/Bink.cs b/PCK-Studio/Classes/FileTypes/Bink.cs index 3d25075b..db79fafa 100644 --- a/PCK-Studio/Classes/FileTypes/Bink.cs +++ b/PCK-Studio/Classes/FileTypes/Bink.cs @@ -74,7 +74,6 @@ namespace PckStudio.Classes public void CleanUpBinka() { - FreeLibrary(library); File.Delete(binka_enc_loc); File.Delete(binkawin_loc); while (File.Exists(mss32_loc)) diff --git a/PCK-Studio/Forms/Editor/AudioEditor.cs b/PCK-Studio/Forms/Editor/AudioEditor.cs index ca958a1b..c8956766 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.cs +++ b/PCK-Studio/Forms/Editor/AudioEditor.cs @@ -87,24 +87,10 @@ namespace PckStudio.Forms.Editor playOverworldInCreative.Enabled = audioFile.HasCategory(PCKAudioFile.AudioCategory.EAudioType.Creative); } - // https://stackoverflow.com/a/25064568 by Alik Khilazhev -MattNL - private void ExtractResource(string resName, string fName) - { - object ob = Properties.Resources.ResourceManager.GetObject(resName); - byte[] myResBytes = (byte[])ob; - using (FileStream fsDst = new FileStream(fName, FileMode.CreateNew, FileAccess.Write)) - { - byte[] bytes = myResBytes; - fsDst.Write(bytes, 0, bytes.Length); - fsDst.Close(); - fsDst.Dispose(); - } - } - private void AudioEditor_FormClosed(object sender, FormClosedEventArgs e) { - //FreeLibrary(library); - BINK.CleanUpBinka(); + // Clean up is throwing an error of some kind? FreeLibrary maybe?? + //BINK.CleanUpBinka(); } private void verifyFileLocationToolStripMenuItem_Click(object sender, EventArgs e)