Skip to content

Improve thread safety in AquaNativeRendering and close stream in getStringResource()#15

Open
karlvr wants to merge 1 commit intovioletlib:masterfrom
karlvr:fix/native-rendering-init
Open

Improve thread safety in AquaNativeRendering and close stream in getStringResource()#15
karlvr wants to merge 1 commit intovioletlib:masterfrom
karlvr:fix/native-rendering-init

Conversation

@karlvr
Copy link
Copy Markdown

@karlvr karlvr commented Mar 17, 2026

Make createPainter() consistent with the thread-aware synchronized findPainterClasses() by making isInitialized volatile and is set after preferredPainter. This guarantees correct visibility if createPainter() is ever called from outside the UI thread.

Also close the InputStream in getStringResource() using try-with-resources.

…tringResource()

Make createPainter() consistent with the thread-aware synchronized
findPainterClasses() by ensuring isInitialized is volatile and is set
after preferredPainter. This guarantees correct visibility if
createPainter() is ever called from outside the UI thread.

Also close the InputStream in getStringResource() using
try-with-resources.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant