From 609549c9335bb4d031081fb805d268117b3ef731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Mon, 28 Dec 2015 22:38:23 +0100 Subject: [PATCH] bugfix --- ios/GLCanvas.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ios/GLCanvas.m b/ios/GLCanvas.m index 24141ae..f3d9deb 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; -- 2.26.2