Skip to content

Commit

Permalink
fixed issue where -ea caused a lot of PG access errors
Browse files Browse the repository at this point in the history
  • Loading branch information
redrezo committed Feb 25, 2020
1 parent eab9f06 commit 0016950
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.Node;
import javafx.scene.Scene;

//Note: this implementation is against internal JavafX API
@SuppressWarnings({"restriction", "deprecation"})
Expand Down Expand Up @@ -147,10 +148,15 @@ public long getNativeSurfaceHandle() {
public DriftFXSurface() {
JNINativeSurface jni = new JNINativeSurface(
(frame) -> {
NGDriftFXSurface ngSurface = impl_getPeer();
ngSurface.present(frame);
Platform.runLater(() -> {
impl_markDirty(DirtyBits.NODE_CONTENTS);
Scene.impl_setAllowPGAccess(true);
try {
NGDriftFXSurface ngSurface = impl_getPeer();
ngSurface.present(frame);
impl_markDirty(DirtyBits.NODE_CONTENTS);
} finally {
Scene.impl_setAllowPGAccess(false);
}
});
});
nativeSurfaceId = NativeAPI.createNativeSurface(jni);
Expand All @@ -166,6 +172,8 @@ public DriftFXSurface() {
});
});
}



@Override
protected NGNode impl_createPeer() {
Expand Down

0 comments on commit 0016950

Please sign in to comment.