Skip to content

Commit 145a797

Browse files
committed
synchronized back some methods. seems to fix rnc-archive#21
1 parent 17857f5 commit 145a797

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

android/src/main/java/fr/greweb/rnwebgl/RNWebGLView.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void run() {
5858
}
5959
}
6060

61-
public void onDrawFrame(GL10 unused) {
61+
public synchronized void onDrawFrame(GL10 unused) {
6262
// Flush any queued events
6363
for (Runnable r : mEventQueue) {
6464
r.run();
@@ -83,11 +83,11 @@ public void onDetachedFromWindow() {
8383
super.onDetachedFromWindow();
8484
}
8585

86-
public void runOnGLThread(Runnable r) {
86+
public synchronized void runOnGLThread(Runnable r) {
8787
mEventQueue.add(r);
8888
}
8989

90-
public static void runOnGLThread(int ctxId, Runnable r) {
90+
public synchronized static void runOnGLThread(int ctxId, Runnable r) {
9191
RNWebGLView glView = mGLViewMap.get(ctxId);
9292
if (glView != null) {
9393
glView.runOnGLThread(r);

0 commit comments

Comments
 (0)