@@ -181,7 +181,9 @@ public static void CPWork(object sender, DoWorkEventArgs e)
181181 if ( MainWindow . KMCGlobals . CancellationPendingValue == 1 )
182182 break ;
183183 }
184- BASSControl . ReleaseResources ( ( MainWindow . KMCGlobals . CancellationPendingValue != 1 ) ) ;
184+
185+ BASSControl . ReleaseResources ( ( MainWindow . KMCGlobals . CancellationPendingValue != 1 ) , ( MainWindow . KMCGlobals . CancellationPendingValue == 1 ) ) ;
186+ if ( MainWindow . KMCGlobals . CancellationPendingValue == 1 ) break ;
185187 }
186188
187189 MainWindow . KMCStatus . RenderingMode = false ;
@@ -206,7 +208,7 @@ public static void CPWork(object sender, DoWorkEventArgs e)
206208 catch ( Exception exception )
207209 {
208210 BasicFunctions . WriteToConsole ( exception ) ;
209- BASSControl . ReleaseResources ( false ) ;
211+ BASSControl . ReleaseResources ( false , true ) ;
210212 }
211213 }
212214 catch ( Exception exception2 )
@@ -255,7 +257,9 @@ public static void CPRWork(object sender, DoWorkEventArgs e)
255257 }
256258 else break ;
257259 }
258- BASSControl . ReleaseResources ( ( MainWindow . KMCGlobals . CancellationPendingValue != 1 ) ) ;
260+
261+ BASSControl . ReleaseResources ( ( MainWindow . KMCGlobals . CancellationPendingValue != 1 ) , ( MainWindow . KMCGlobals . CancellationPendingValue == 1 ) ) ;
262+ if ( MainWindow . KMCGlobals . CancellationPendingValue == 1 ) break ;
259263 }
260264
261265 MainWindow . KMCStatus . RenderingMode = false ;
@@ -266,7 +270,7 @@ public static void CPRWork(object sender, DoWorkEventArgs e)
266270 String Msg = ( MainWindow . KMCGlobals . CancellationPendingValue == 1 ) ? "ConversionAborted" : "ConversionCompleted" ;
267271 BASSControl . BASSCloseStream ( Languages . Parse ( Msg ) , Languages . Parse ( Msg ) , 0 ) ;
268272
269- if ( MainWindow . KMCGlobals . CancellationPendingValue ! = 1 )
273+ if ( MainWindow . KMCGlobals . CancellationPendingValue = = 1 )
270274 {
271275 if ( MainWindow . KMCGlobals . AutoShutDownEnabled == true )
272276 Process . Start ( new ProcessStartInfo ( "shutdown" , "/s /t 0" ) { CreateNoWindow = true , UseShellExecute = false } ) ;
@@ -280,7 +284,7 @@ public static void CPRWork(object sender, DoWorkEventArgs e)
280284 catch ( Exception exception )
281285 {
282286 BasicFunctions . WriteToConsole ( exception ) ;
283- BASSControl . ReleaseResources ( false ) ;
287+ BASSControl . ReleaseResources ( false , true ) ;
284288 }
285289 }
286290 catch ( Exception exception2 )
@@ -343,7 +347,9 @@ public static void PBWork(object sender, DoWorkEventArgs e)
343347
344348 TimerFuncs . MicroSleep ( - 1 ) ;
345349 }
346- BASSControl . ReleaseResources ( ( MainWindow . KMCGlobals . CancellationPendingValue != 1 ) ) ;
350+
351+ BASSControl . ReleaseResources ( ( MainWindow . KMCGlobals . CancellationPendingValue != 1 ) , ( MainWindow . KMCGlobals . CancellationPendingValue == 1 ) ) ;
352+ if ( MainWindow . KMCGlobals . CancellationPendingValue == 1 ) break ;
347353 }
348354
349355 MainWindow . KMCStatus . RenderingMode = false ;
@@ -359,7 +365,7 @@ public static void PBWork(object sender, DoWorkEventArgs e)
359365 catch ( Exception exception )
360366 {
361367 BasicFunctions . WriteToConsole ( exception ) ;
362- BASSControl . ReleaseResources ( false ) ;
368+ BASSControl . ReleaseResources ( false , true ) ;
363369 }
364370 }
365371 catch ( Exception exception2 )
@@ -426,7 +432,9 @@ public static void PBRWork(object sender, DoWorkEventArgs e)
426432
427433 TimerFuncs . MicroSleep ( - 1 ) ;
428434 }
429- BASSControl . ReleaseResources ( ( MainWindow . KMCGlobals . CancellationPendingValue != 1 ) ) ;
435+
436+ BASSControl . ReleaseResources ( ( MainWindow . KMCGlobals . CancellationPendingValue != 1 ) , ( MainWindow . KMCGlobals . CancellationPendingValue == 1 ) ) ;
437+ if ( MainWindow . KMCGlobals . CancellationPendingValue == 1 ) break ;
430438 }
431439
432440 MainWindow . KMCStatus . RenderingMode = false ;
@@ -442,7 +450,7 @@ public static void PBRWork(object sender, DoWorkEventArgs e)
442450 catch ( Exception exception )
443451 {
444452 BasicFunctions . WriteToConsole ( exception ) ;
445- BASSControl . ReleaseResources ( false ) ;
453+ BASSControl . ReleaseResources ( false , true ) ;
446454 }
447455 }
448456 catch ( Exception exception2 )
0 commit comments