Use htmlOutputView.runningCommand instead of command::runner_t

The latter is updated via a dispatch queue and thus might be delayed (to after end of current event loop cycle). This is relevant when WebView itself terminates the URL loading and calls the “WebView should close” delegate method.

Here the HTML output view property has been updated (via the WebView delegate method) but the command runner has not yet executed the completion code (which updates it’s “is running” state).
This commit is contained in:
Allan Odgaard
2014-03-28 19:18:30 +07:00
parent 5a8967e88e
commit 74d6cc47da

View File

@@ -77,7 +77,7 @@ OAK_DEBUG_VAR(HTMLOutputWindow);
- (BOOL)running
{
return _commandRunner->running();
return self.htmlOutputView.runningCommand;
}
- (BOOL)needsNewWebView
@@ -88,7 +88,7 @@ OAK_DEBUG_VAR(HTMLOutputWindow);
- (BOOL)windowShouldClose:(id)sender
{
D(DBF_HTMLOutputWindow, bug("\n"););
if(!_commandRunner->running())
if(!self.running)
return YES;
NSAlert* alert = [NSAlert alertWithMessageText:@"Stop task before closing?" defaultButton:@"Stop Task" alternateButton:@"Cancel" otherButton:nil informativeTextWithFormat:@"The job that the task is performing will not be completed."];