attach icon indicating copy to clipboard operation
attach copied to clipboard

Native Callbacks fail if service is started from background thread

Open jperedadnr opened this issue 5 years ago • 1 comments

Gluon Attach services need to be initialized from the JavaFX thread, in order to perform the callbacks to the same thread

If any service is initialized from another thread (i.e. a background thread), the native part will work, but the callbacks will fail (and the app will crash)

Investigate the use of AttachCurrentThread, or document the use of Platform.isFxApplicationThread() to do the service initialization from Platform.runLater().

jperedadnr avatar Feb 07 '20 15:02 jperedadnr

safest approach in case of unsure is to start a new native thread, let that do the work, and call AttachThread on that.

johanvos avatar Feb 07 '20 16:02 johanvos