Skip to content

Commit

Permalink
Add more reachabilityFence
Browse files Browse the repository at this point in the history
  • Loading branch information
BloCamLimb committed Dec 5, 2024
1 parent 02db33a commit c40f7e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/java/icyllis/modernui/core/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.lwjgl.system.NativeType;

import javax.annotation.concurrent.NotThreadSafe;
import java.lang.ref.Reference;
import java.nio.IntBuffer;

import static org.lwjgl.glfw.GLFW.*;
Expand Down Expand Up @@ -126,6 +127,8 @@ public void setIcon(@Nullable Bitmap... icons) {
}
images.flip();
glfwSetWindowIcon(mHandle, images);
} finally {
Reference.reachabilityFence(icons);
}
}

Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/icyllis/modernui/graphics/Bitmap.java
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ public void getPixels(@NonNull Bitmap dst, int dstX, int dstY,
}
} finally {
Reference.reachabilityFence(this);
Reference.reachabilityFence(dst);
}
}

Expand Down Expand Up @@ -1095,6 +1096,7 @@ public void setPixels(@NonNull Bitmap src, int srcX, int srcY,
}
} finally {
Reference.reachabilityFence(this);
Reference.reachabilityFence(src);
}
}

Expand Down

0 comments on commit c40f7e0

Please sign in to comment.