diff --git a/ios/GLCanvas.m b/ios/GLCanvas.m index 24141aed0ed5c19aac20758cb48230d21e624d93..f3d9deb18bf692781a9829b72491b628bb2d6aa4 100644 --- a/ios/GLCanvas.m +++ b/ios/GLCanvas.m @@ -112,7 +112,12 @@ RCT_NOT_IMPLEMENTED(-init) - (void)setAutoRedraw:(BOOL)autoRedraw { _autoRedraw = autoRedraw; - if (autoRedraw) { + [self performSelectorOnMainThread:@selector(syncAutoRedraw) withObject:nil waitUntilDone:false]; +} + +- (void)syncAutoRedraw +{ + if (_autoRedraw) { if (!animationTimer) animationTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/60.0 @@ -304,7 +309,7 @@ RCT_NOT_IMPLEMENTED(-init) } else { imgData = nil; } - contentData[i] = imgData; + if (imgData) contentData[i] = imgData; } _contentData = contentData; _deferredRendering = false;