diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPAppController.h | 1 | ||||
-rw-r--r-- | Source/SPAppController.m | 15 | ||||
-rw-r--r-- | Source/SPBundleHTMLOutputController.m | 4 |
3 files changed, 12 insertions, 8 deletions
diff --git a/Source/SPAppController.h b/Source/SPAppController.h index fe80e2d9..27985be6 100644 --- a/Source/SPAppController.h +++ b/Source/SPAppController.h @@ -117,5 +117,6 @@ - (NSDictionary*)shellEnvironmentForDocument:(NSString*)docUUID; - (void)addHTMLOutputController:(id)controller; +- (void)removeHTMLOutputController:(id)controller; @end diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 4f4bab2c..5686854b 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1515,13 +1515,19 @@ YY_BUFFER_STATE yy_scan_string (const char *); [bundleHTMLOutputController addObject:controller]; } +- (void)removeHTMLOutputController:(id)controller +{ + [bundleHTMLOutputController removeObject:controller]; +} + - (IBAction)reloadBundles:(id)sender { - // Force releasing of any HTML output windows - for(id c in bundleHTMLOutputController) { - if(![[c window] isVisible]) { - [c release]; + // Force releasing of any hidden HTML output windows, which will automatically remove them from the array. + // Keep the visible windows. + for (id c in bundleHTMLOutputController) { + if (![[c window] isVisible]) { + [[c window] performClose:self]; } } @@ -1529,7 +1535,6 @@ YY_BUFFER_STATE yy_scan_string (const char *); [bundleItems removeAllObjects]; [bundleUsedScopes removeAllObjects]; - [bundleHTMLOutputController removeAllObjects]; [bundleCategories removeAllObjects]; [bundleTriggers removeAllObjects]; [bundleKeyEquivalents removeAllObjects]; diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index 9243741c..cff150c0 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -59,9 +59,6 @@ { if ((self = [super initWithWindowNibName:@"BundleHTMLOutput"])) { - - [[self window] setReleasedWhenClosed:YES]; - [webView setContinuousSpellCheckingEnabled:NO]; [webView setGroupName:@"SequelProBundleHTMLOutput"]; [webView setDrawsBackground:YES]; @@ -286,6 +283,7 @@ [self setInitHTMLSourceString:@""]; windowUUID = @""; docUUID = @""; + [[NSApp delegate] removeHTMLOutputController:self]; [self release]; } |