Skip to content

Commit 0b9fb7e

Browse files
committed
* Make a difficult mutex check a bit easier to read and hopefully a bit 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")
1 parent 0f40c5e commit 0b9fb7e

File tree

3 files changed

+186
-190
lines changed

3 files changed

+186
-190
lines changed

Diff for: Source/SPConstants.h

+9
Original file line numberDiff line numberDiff line change
@@ -682,3 +682,12 @@ typedef NSUInteger NSCellHitResult;
682682

683683
// See http://stackoverflow.com/questions/4415524
684684
#define COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
685+
686+
// This definition is mostly for legibility
687+
#ifndef ESUCCESS
688+
#define ESUCCESS 0
689+
#else
690+
#if ESUCCESS != 0
691+
#error 'ESUCCESS' must be defined as zero!
692+
#endif
693+
#endif

Diff for: Source/SPDatabaseStructure.h

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
// Setup and teardown
5252
- (id)initWithDelegate:(SPDatabaseDocument *)theDelegate;
5353
- (void)setConnectionToClone:(SPMySQLConnection *)aConnection;
54-
- (void)destroy:(NSNotification *)notification;
5554

5655
// Information
5756
- (SPMySQLConnection *)connection;

0 commit comments

Comments
 (0)