Skip to content
This repository has been archived by the owner on Nov 30, 2019. It is now read-only.

Commit

Permalink
fixed queue memory management, closes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwijas committed Apr 8, 2013
1 parent f9d1448 commit 93923da
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Project/UISS/UISS.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
#import "UISSStatusWindow.h"

#if UISS_DEBUG

#import "UISSAppearancePrivate.h"

#endif

NSString *const UISSWillApplyStyleNotification = @"UISSWillApplyStyleNotification";
Expand All @@ -27,7 +29,7 @@ @interface UISS () <UISSStatusWindowControllerDelegate>
@property(nonatomic, strong) UISSStatusWindow *statusWindow;

@property(nonatomic, strong) NSTimer *autoReloadTimer;
@property(nonatomic, assign) dispatch_queue_t queue; // all style parsing is done on the queue
@property(nonatomic, unsafe_unretained) dispatch_queue_t queue; // all style parsing is done on the queue

@property(nonatomic, strong) UISSCodeGenerator *codeGenerator;

Expand Down Expand Up @@ -58,6 +60,10 @@ - (id)init {
return self;
}

- (void)dealloc {
dispatch_release(self.queue);
}

- (void)logDebugMessageOnce {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Expand Down Expand Up @@ -153,7 +159,7 @@ - (void)loadStyleSynchronously {
if ([self.style parseDictionaryForUserInterfaceIdiom:userInterfaceIdiom withConfig:self.config]) {
propertySetters = [self.style propertySettersForUserInterfaceIdiom:userInterfaceIdiom];
}
});
});

if (propertySetters) {
[self configureAppearanceWithPropertySetters:propertySetters errors:self.style.errors];
Expand All @@ -174,6 +180,7 @@ - (void)refreshViews {
}

#if UISS_DEBUG

- (void)resetAppearanceForPropertySetters:(NSArray *)propertySetters {
UISS_LOG(@"resetting appearance");

Expand All @@ -183,6 +190,7 @@ - (void)resetAppearanceForPropertySetters:(NSArray *)propertySetters {

[self.configuredAppearanceProxies removeAllObjects];
}

#endif

#pragma mark - Code Generation
Expand Down

0 comments on commit 93923da

Please sign in to comment.