aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-03-20 01:26:38 +0000
committerrowanbeentje <rowan@beent.je>2012-03-20 01:26:38 +0000
commitbe12cd54abe6cc10ccb61fca3d5f27032d983506 (patch)
treec77681a659106911ce0656e733ee9e74961df464 /Source/SPAppController.m
parentf37571808b516360a9f1f6f6291f6469e30b7c06 (diff)
downloadsequelpro-be12cd54abe6cc10ccb61fca3d5f27032d983506.tar.gz
sequelpro-be12cd54abe6cc10ccb61fca3d5f27032d983506.tar.bz2
sequelpro-be12cd54abe6cc10ccb61fca3d5f27032d983506.zip
- Fix crashes caused by using SPBundleHTMLOutputController windows, closing them, and then triggering bundle reloads (eg via right-clicking)
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r--Source/SPAppController.m15
1 files changed, 10 insertions, 5 deletions
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];