Fix race condition in FilamentPanel (#287)

This commit is contained in:
Ben Doherty
2018-09-24 13:52:36 -07:00
committed by GitHub
parent 22f7599e73
commit eed424530d

View File

@@ -197,6 +197,11 @@ public class FilamentPanel extends JPanel implements FilamentTarget {
if (mNativeSurface == null) {
return;
}
// Previous frames using this surface may still be in the pipeline, so we must wait for
// them to finish.
engine.flushAndWait();
mNativeSurface.dispose();
engine.destroySwapChain(mSwapChain);
}