Skip to content

Commit

Permalink
Corrected failure detection logic. Fixed race condition which caused
Browse files Browse the repository at this point in the history
lights to turn off immediately after turning them on. Upgraded manifest
to version 2.5.
  • Loading branch information
sabaatworld committed Jan 28, 2018
1 parent c58993a commit 2c3b599
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions HyperionScreenCap/Form/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,11 @@ private void DisableCaptureOnFailure()
{
if ( !task.CaptureEnabled )
{
ToggleCapture(CaptureCommand.OFF);
break;
// We have found a task for which capture has been disabled due to failure
// Turning off capture and exiting this thread
LOG.Error($"Found {task} with capture disabled due to failure. Issuing OFF command.");
ToggleCapture(CaptureCommand.OFF, false, false);
return;
}
}
Thread.Sleep(AppConstants.CAPTURE_FAILURE_DETECTION_INTERVAL);
Expand Down
2 changes: 1 addition & 1 deletion HyperionScreenCap/Helper/HyperionTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ private void StartCapture()

private void TryStartCapture()
{
CaptureEnabled = true;
try // Properly dispose everything object when turning off capture
{
StartCapture();
Expand All @@ -196,6 +195,7 @@ private void TryStartCapture()
public void EnableCapture()
{
LOG.Info($"{this}: Enabling screen capture");
CaptureEnabled = true;
_captureThread = new Thread(TryStartCapture) { IsBackground = true };
_captureThread.Start();
}
Expand Down
2 changes: 1 addition & 1 deletion HyperionScreenCap/Installation Files/InstallScript.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Hyperion Screen Capture"
#define MyAppVersion "2.4"
#define MyAppVersion "2.5"
#define MyAppPublisher "@sabaatworld"
#define MyAppURL "https://github.com/sabaatworld/HyperionScreenCap"
#define MyAppUpdatesURL "https://github.com/sabaatworld/HyperionScreenCap/releases"
Expand Down
2 changes: 1 addition & 1 deletion HyperionScreenCap/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.0.0")]
[assembly: AssemblyVersion("2.5.0.0")]
//[assembly: AssemblyFileVersion("2.0.0.0")] Commented out so that it will be generated automatically

0 comments on commit 2c3b599

Please sign in to comment.