This is an automated email from the ASF dual-hosted git repository.
harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 30a0a27a1a Fix sync calls of tasks
30a0a27a1a is described below
commit 30a0a27a1a48e589c672fa32a777b9ebe15a26bc
Author: Harbs <[email protected]>
AuthorDate: Wed Mar 5 10:45:31 2025 +0200
Fix sync calls of tasks
---
.../Core/src/main/royale/org/apache/royale/utils/async/AsyncTask.as | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/AsyncTask.as
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/AsyncTask.as
index 92c17a5aae..541b3827be 100644
---
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/AsyncTask.as
+++
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/AsyncTask.as
@@ -137,6 +137,10 @@ package org.apache.royale.utils.async
* @productversion Royale 0.9.6
*/
public function done(callback:Function):IAsyncTask{
+ if(_status == "complete" || _status == "failed"){
+ callback(this);
+ return this;
+ }
if(!doneCallbacks){
doneCallbacks = [];
}
@@ -156,8 +160,8 @@ package org.apache.royale.utils.async
*/
public function exec(callback:Function):IAsyncTask
{
- run();
done(callback);
+ run();
return this;
}
public abstract function run(data:Object=null):void;