TooTallNate / node-speaker

Output PCM audio data to the speakers
648 stars 145 forks source link

use Nan::GetCurrentEventLoop for threadsafety #121

Closed hlolli closed 6 years ago

hlolli commented 6 years ago

Without this, nodejs segfaults when speaker is running in a seperate thread. This is the function used in the Nan examples

https://github.com/nodejs/nan/blob/139920eddc1afcf6590c218316b47070a4b9a1e8/test/cpp/asyncresource.cpp

I just noticed now, that with only this change, nodejs results in livelock (only when node-speaker is on another thread), so some part of my other PR is important here as well.

LinusU commented 6 years ago

Thanks!

LinusU commented 5 years ago

🚢 Released in 0.4.2