|
@@ -182,6 +182,9 @@ static NSString *const KMPurchaseCompareCellIdentifier = @"KMPurchaseCompa
|
|
|
|
|
|
#pragma mark - KMPurchaseCompareWindowController
|
|
|
|
|
|
+static KMPurchaseCompareDMGWindowController *dmgSingleton = nil;
|
|
|
+static KMPurchaseFirstTrialWindowController *firstTrialSingleton = nil;
|
|
|
+
|
|
|
@interface KMPurchaseCompareWindowController ()<NSTableViewDelegate, NSTableViewDataSource>
|
|
|
|
|
|
@property (nonatomic,assign) NSModalSession modalSession;
|
|
@@ -297,19 +300,15 @@ static NSString *const KMPurchaseCompareCellIdentifier = @"KMPurchaseCompa
|
|
|
+ (NSWindowController *)sharedInstance {
|
|
|
#if VERSION_DMG
|
|
|
if (ActivityStatusNone == [VerificationManager manager].status) {
|
|
|
- static KMPurchaseFirstTrialWindowController *singleton = nil;
|
|
|
- static dispatch_once_t pred;
|
|
|
- dispatch_once(&pred, ^{
|
|
|
- singleton = [KMPurchaseCompareWindowController firstTrialWCCheck];
|
|
|
- });
|
|
|
- return singleton;
|
|
|
+ if (!firstTrialSingleton) {
|
|
|
+ firstTrialSingleton = [KMPurchaseCompareWindowController firstTrialWCCheck];
|
|
|
+ }
|
|
|
+ return firstTrialSingleton;
|
|
|
} else {
|
|
|
- static KMPurchaseCompareDMGWindowController *singleton = nil;
|
|
|
- static dispatch_once_t pred;
|
|
|
- dispatch_once(&pred, ^{
|
|
|
- singleton = [[KMPurchaseCompareDMGWindowController alloc] init];
|
|
|
- });
|
|
|
- return singleton;
|
|
|
+ if (!dmgSingleton) {
|
|
|
+ dmgSingleton = [[KMPurchaseCompareDMGWindowController alloc] init];
|
|
|
+ }
|
|
|
+ return dmgSingleton;
|
|
|
}
|
|
|
#else
|
|
|
static KMPurchaseCompareWindowController *singleton = nil;
|
|
@@ -321,13 +320,18 @@ static NSString *const KMPurchaseCompareCellIdentifier = @"KMPurchaseCompa
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
++ (NSWindowController *)firstTrialInstance {
|
|
|
+ if (!firstTrialSingleton) {
|
|
|
+ firstTrialSingleton = [KMPurchaseCompareWindowController firstTrialWCCheck];
|
|
|
+ }
|
|
|
+ return firstTrialSingleton;
|
|
|
+}
|
|
|
+
|
|
|
+ (NSWindowController *)DMGPurchaseInstance {
|
|
|
- static KMPurchaseCompareDMGWindowController *singleton = nil;
|
|
|
- static dispatch_once_t pred;
|
|
|
- dispatch_once(&pred, ^{
|
|
|
- singleton = [[KMPurchaseCompareDMGWindowController alloc] init];
|
|
|
- });
|
|
|
- return singleton;
|
|
|
+ if (!dmgSingleton) {
|
|
|
+ dmgSingleton = [[KMPurchaseCompareDMGWindowController alloc] init];
|
|
|
+ }
|
|
|
+ return dmgSingleton;
|
|
|
}
|
|
|
|
|
|
#pragma mark - FirstTrial WC
|