1
Vote

Defect in NetSparkle.cs - Exception thrown when calling StartLoop() while RunWorkerAsync() is busy

description

Issue:
Defect - Exception thrown when calling StartLoop() while RunWorkerAsync() is busy
Error Severity: Blocker
Version: 1.0.85 (r105790)
Environment: Windows 7 (x64)
Source of Error: NetSparkle.StartLoop(..)

Reproduce:
  1. Execute test app using, StartLoop(true);
  2. Call, StartLoop(..) again.
    (or)
  3. Begin test app with StartLoop(true);
  4. Call "_sparkle.StopLoop();" then immediately, "_sparkle.StartLoop(true, true);"
Actual Result:
Error will be thrown stating that RunWorkerAsync() is currently busy.

Expected Result:
Handle the error and report it in debug window (see suggested workaround)

Suggested Workaround:
    public void StartLoop(Boolean doInitialCheck, Boolean forceInitialCheck, TimeSpan checkFrequency)
    {

      ...

      // start the work
      // Added try/catch for when RunWorkerAsync() is currently busy so we don't crash the app (2014-01-14 DJS)
      try
      {
        _worker.RunWorkerAsync();
      }
      catch (Exception exc)
      {
        _DiagnosticWindow.Report("Error: Could not execute 'RunWorkerAsync()'. " + exc.Message);
      }
}

comments