Index: src/JsEngine.cpp |
=================================================================== |
--- a/src/JsEngine.cpp |
+++ b/src/JsEngine.cpp |
@@ -22,6 +22,7 @@ |
#include "JsEngineInternal.h" |
#include "JsEngineTransition.h" |
#include "JsError.h" |
+#include "Timeout.h" |
#include "Utils.h" |
#include "WebRequestJsObject.h" |
@@ -377,11 +378,13 @@ |
{ |
// The present version of the scheduler only does immediate and single-use |
// It does not, however, detach threads like the legacy thread behavior did. |
- scheduler.Run(Task(this, std::move(body))); |
+ scheduler.Run(std::forward<std::shared_ptr<TaskFunctionInterface>>(body), |
+ shared_from_this()); |
} |
void JsEngineInternal::WaitForQuietScheduler() |
{ |
+ scheduler.ShutDown(); |
scheduler.JoinAll(); |
} |