diff options
author | Max <post@wickenrode.com> | 2015-10-02 17:04:07 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-10-02 17:04:07 +0200 |
commit | f38ffcb95896ddf3774d30d0c64d8a57139b4ec6 (patch) | |
tree | 216747087624b18b8de275b4d8332fed8bb9e29a | |
parent | 9233309f6d40c1aacd12088821beef5029b7a60c (diff) | |
download | sequelpro-f38ffcb95896ddf3774d30d0c64d8a57139b4ec6.tar.gz sequelpro-f38ffcb95896ddf3774d30d0c64d8a57139b4ec6.tar.bz2 sequelpro-f38ffcb95896ddf3774d30d0c64d8a57139b4ec6.zip |
Add some debug code for another crash that has been happening lately
-rw-r--r-- | Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m | 2 | ||||
-rw-r--r-- | Source/SPObjectAdditions.m | 38 | ||||
-rw-r--r-- | Source/SPTableView.m | 2 |
3 files changed, 39 insertions, 3 deletions
diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m index 48f4fc1e..1b7ec58e 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m @@ -313,7 +313,7 @@ theSqlstate = [self _stringForCString:mysql_sqlstate(mySQLConnection)]; // Prevent retries if the query was cancelled or not a connection error - if (lastQueryWasCancelled || ![SPMySQLConnection isErrorIDConnectionError:mysql_errno(mySQLConnection)]) { + if (lastQueryWasCancelled || ![SPMySQLConnection isErrorIDConnectionError:theErrorID]) { break; } } diff --git a/Source/SPObjectAdditions.m b/Source/SPObjectAdditions.m index 9f51d652..f29aa3b4 100644 --- a/Source/SPObjectAdditions.m +++ b/Source/SPObjectAdditions.m @@ -140,7 +140,7 @@ retryDescribe: if([notificationObserver isKindOfClass:[NSView class]]) { [val appendFormat:@" view info: id=%@, tag=%ld\n",[(NSView *)notificationObserver identifier], [(NSView *)notificationObserver tag]]; } - [val appendFormat:@"\nbacktrace:\n%@\n\n",[NSThread callStackSymbols]]; + [val appendFormat:@"\nregistration backtrace:\n%@\n\n",[NSThread callStackSymbols]]; [gScrollViewListeners setObject:val forKey:key]; } @@ -186,3 +186,39 @@ retryDescribe: @end + +#pragma mark - + +@interface NSAlert (ApplePrivate) + +- (IBAction)buttonPressed:(id)sender; + +@end + +@implementation NSAlert (SPAlertDebug) + ++ (void)load +{ + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + Class alertClass = [self class]; + + SEL orig = @selector(buttonPressed:); + SEL exch = @selector(sp_buttonPressed:); + + Method origM = class_getInstanceMethod(alertClass, orig); + Method exchM = class_getInstanceMethod(alertClass, exch); + + method_exchangeImplementations(origM, exchM); + }); +} + +- (IBAction)sp_buttonPressed:(id)obj +{ + NSLog(@"%s of %@ title=\n%@\ntext=\n%@",__func__,self,[self messageText],[self informativeText]); + + [self sp_buttonPressed:obj]; +} + +@end diff --git a/Source/SPTableView.m b/Source/SPTableView.m index 7a1c01c1..3b1cf507 100644 --- a/Source/SPTableView.m +++ b/Source/SPTableView.m @@ -72,7 +72,7 @@ if ([NSTableView instancesRespondToSelector:@selector(awakeFromNib)]) { [super awakeFromNib]; -} + } } #pragma mark - |