fix severe termination bug
This commit is contained in:
@@ -222,6 +222,12 @@ namespace mpvnet
|
||||
InvokeAsync(InitializedAsync);
|
||||
}
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
mpv_destroy(Handle);
|
||||
mpv_destroy(NamedHandle);
|
||||
}
|
||||
|
||||
void ApplyShowMenuFix()
|
||||
{
|
||||
if (App.Settings.ShowMenuFixApplied)
|
||||
@@ -1732,6 +1738,9 @@ namespace mpvnet
|
||||
|
||||
if (title.TrimEx() == format)
|
||||
title = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(title))
|
||||
title = title.Trim(" _-".ToCharArray());
|
||||
}
|
||||
|
||||
track = new MediaTrack();
|
||||
@@ -1815,6 +1824,9 @@ namespace mpvnet
|
||||
|
||||
if (title.ContainsEx("[]"))
|
||||
title = title.Replace("[]", "");
|
||||
|
||||
if (!string.IsNullOrEmpty(title))
|
||||
title = title.Trim(" _-".ToCharArray());
|
||||
}
|
||||
|
||||
track = new MediaTrack();
|
||||
|
||||
@@ -14,6 +14,9 @@ public class libmpv
|
||||
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern mpv_error mpv_initialize(IntPtr mpvHandle);
|
||||
|
||||
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void mpv_destroy(IntPtr mpvHandle);
|
||||
|
||||
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern mpv_error mpv_command(IntPtr mpvHandle, IntPtr strings);
|
||||
|
||||
|
||||
@@ -1235,6 +1235,8 @@ namespace mpvnet
|
||||
|
||||
if (!Core.ShutdownAutoResetEvent.WaitOne(10000))
|
||||
Msg.ShowError("Shutdown thread failed to complete within 10 seconds.");
|
||||
|
||||
Core.Destroy();
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user