Wrap all async JS callbacks, help avoid possible race #3569

This commit is contained in:
Lovell Fuller
2023-03-01 12:41:11 +00:00
parent 0063df4d4f
commit 4ec883eaa0
4 changed files with 8 additions and 5 deletions

View File

@@ -106,7 +106,7 @@ class StatsWorker : public Napi::AsyncWorker {
// Handle warnings
std::string warning = sharp::VipsWarningPop();
while (!warning.empty()) {
debuglog.Call({ Napi::String::New(env, warning) });
debuglog.MakeCallback(Receiver().Value(), { Napi::String::New(env, warning) });
warning = sharp::VipsWarningPop();
}