Skip to content

Commit

Permalink
* Make a difficult mutex check a bit easier to read and hopefully a b…
Browse files Browse the repository at this point in the history
…it safer, too

* Reorder some code
* Replace some duplicate code with goto
* Simplify some if's

Maybe this also has some influence on our current top crash ("Attempted to connect a connection that is not disconnected")
  • Loading branch information
dmoagx committed Nov 14, 2015
1 parent 0f40c5e commit 0b9fb7e
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 190 deletions.
9 changes: 9 additions & 0 deletions Source/SPConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,12 @@ typedef NSUInteger NSCellHitResult;

// See https://stackoverflow.com/questions/4415524
#define COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))

// This definition is mostly for legibility
#ifndef ESUCCESS
#define ESUCCESS 0
#else
#if ESUCCESS != 0
#error 'ESUCCESS' must be defined as zero!
#endif
#endif
1 change: 0 additions & 1 deletion Source/SPDatabaseStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
// Setup and teardown
- (id)initWithDelegate:(SPDatabaseDocument *)theDelegate;
- (void)setConnectionToClone:(SPMySQLConnection *)aConnection;
- (void)destroy:(NSNotification *)notification;

// Information
- (SPMySQLConnection *)connection;
Expand Down
Loading

0 comments on commit 0b9fb7e

Please sign in to comment.