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)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user