From 9b1ea2464809eb524e7cfaf71a08d63585d32bdf Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Thu, 17 Oct 2024 13:41:20 -0700 Subject: [PATCH] FileDialog: Fixes issue where file dialog stops responding in HashLink on Windows (closes #1849) Does not seem to recover when it happens, requiring the Lime app to be force closed. Some kind of threading issue that is affecting HashLink on Windows only (macOS and Linux are fine, and other sys targets are fine). Fixed by passing SINGLE_THREADED to ThreadPool constructor using #if (windows && hl) --- src/lime/ui/FileDialog.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lime/ui/FileDialog.hx b/src/lime/ui/FileDialog.hx index 61201b9fb..d5bc70d99 100644 --- a/src/lime/ui/FileDialog.hx +++ b/src/lime/ui/FileDialog.hx @@ -99,7 +99,7 @@ class FileDialog if (type == null) type = FileDialogType.OPEN; #if desktop - var worker = new ThreadPool(); + var worker = new ThreadPool(#if (windows && hl) SINGLE_THREADED #end); worker.onComplete.add(function(result) { @@ -224,7 +224,7 @@ class FileDialog public function open(filter:String = null, defaultPath:String = null, title:String = null):Bool { #if (desktop && sys) - var worker = new ThreadPool(); + var worker = new ThreadPool(#if (windows && hl) SINGLE_THREADED #end); worker.onComplete.add(function(path:String) { @@ -287,7 +287,7 @@ class FileDialog } #if (desktop && sys) - var worker = new ThreadPool(); + var worker = new ThreadPool(#if (windows && hl) SINGLE_THREADED #end); worker.onComplete.add(function(path:String) {