diff options
-rw-r--r-- | Source/SPDatabaseDocument.m | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 62fe2357..21f774e5 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -3084,7 +3084,9 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0; - (void)saveConnectionPanelDidEnd:(NSSavePanel *)panel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { - if (returnCode) { + [panel orderOut:nil]; // by default OS X hides the panel only after the current method is done + + if (returnCode == NSFileHandlingPanelOKButton) { NSString *fileName = [[panel URL] path]; NSError *error = nil; @@ -3120,7 +3122,8 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0; [self saveDocumentWithFilePath:fileName inBackground:NO onlyPreferences:NO contextInfo:nil]; // Manually loaded nibs don't have their top-level objects released automatically - do that here. - SPClear(saveConnectionAccessory); + [saveConnectionAccessory autorelease]; + saveConnectionAccessory = nil; if(contextInfo == @"saveSPFfileAndClose") [self closeAndDisconnect]; @@ -4444,8 +4447,9 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0; */ - (void)setFileURL:(NSURL *)theURL { - if (spfFileURL) SPClear(spfFileURL); - spfFileURL = [theURL retain]; + [theURL retain]; + [spfFileURL release]; + spfFileURL = theURL; if ([parentWindowController selectedTableDocument] == self) { if (spfFileURL && [spfFileURL isFileURL]) [parentWindow setRepresentedURL:spfFileURL]; |