Skip to content

Commit

Permalink
Improve robustness of initial cleanup (fixes jansi#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Oct 20, 2023
1 parent 60de931 commit 58fd8f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion native/src/main/java/org/jline/nativ/JLineNativeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public class JLineNativeLoader {
public static synchronized boolean initialize() {
// only cleanup before the first extract
if (!loaded) {
cleanup();
Thread cleanup = new Thread(JLineNativeLoader::cleanup, "cleanup");
cleanup.setPriority(Thread.MIN_PRIORITY);
cleanup.setDaemon(true);
cleanup.start();
}
try {
loadJLineNativeLibrary();
Expand Down

0 comments on commit 58fd8f9

Please sign in to comment.