diff --git a/AsyncDisplayKit/ASMapNode.mm b/AsyncDisplayKit/ASMapNode.mm index fcfd821487..aaf171ffe3 100644 --- a/AsyncDisplayKit/ASMapNode.mm +++ b/AsyncDisplayKit/ASMapNode.mm @@ -13,6 +13,7 @@ #import #import #import +#import @interface ASMapNode() { @@ -63,19 +64,23 @@ - (void)fetchData { [super fetchData]; - if (self.isLiveMap) { - [self addLiveMap]; - } else { - [self takeSnapshot]; - } + ASPerformBlockOnMainThread(^{ + if (self.isLiveMap) { + [self addLiveMap]; + } else { + [self takeSnapshot]; + } + }); } -- (void)clearContents +- (void)clearFetchedData { - [super clearContents]; - if (self.isLiveMap) { - [self removeLiveMap]; - } + [super clearFetchedData]; + ASPerformBlockOnMainThread(^{ + if (self.isLiveMap) { + [self removeLiveMap]; + } + }); } #pragma mark - Settings