1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-22 18:15:47 +02:00

Fix crash when clicking video overlay after a playback error

This commit is contained in:
chylex 2017-09-17 19:06:12 +02:00
parent 3cdc1e190a
commit dbade7f854

View File

@ -147,7 +147,15 @@ private void owner_FormClosing(object sender, FormClosingEventArgs e){
}
private void process_Exited(object sender, EventArgs e){
switch(currentProcess.ExitCode){
int exitCode = currentProcess.ExitCode;
currentProcess.Dispose();
currentProcess = null;
currentPipe.Dispose();
currentPipe = null;
switch(exitCode){
case 3: // CODE_LAUNCH_FAIL
if (FormMessage.Error("Video Playback Error", "Error launching video player, this may be caused by missing Windows Media Player. Do you want to open the video in a browser?", FormMessage.Yes, FormMessage.No)){
BrowserUtils.OpenExternalBrowser(lastUrl);
@ -162,12 +170,6 @@ private void process_Exited(object sender, EventArgs e){
break;
}
currentProcess.Dispose();
currentProcess = null;
currentPipe.Dispose();
currentPipe = null;
owner.InvokeAsyncSafe(TriggerProcessExitEventUnsafe);
}