Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with reset() and finalize() in the new api #77

Open
natcl opened this issue Mar 30, 2018 · 2 comments
Open

problems with reset() and finalize() in the new api #77

natcl opened this issue Mar 30, 2018 · 2 comments

Comments

@natcl
Copy link
Contributor

natcl commented Mar 30, 2018

With the new version (1.x)
I get the following error when I call reset():

Press <ctrl>+C to exit.
^C/home/pi/leds/node_modules/rpi-ws281x-native/lib/ws281x-native.js:93
    this.array.fill(0);
              ^

TypeError: Cannot read property 'fill' of null
    at Channel.[_reset] (/home/pi/leds/node_modules/rpi-ws281x-native/lib/ws281x-native.js:93:15)
    at channels.forEach.channel (/home/pi/leds/node_modules/rpi-ws281x-native/lib/ws281x-native.js:173:46)
    at Array.forEach (native)
    at Function.reset (/home/pi/leds/node_modules/rpi-ws281x-native/lib/ws281x-native.js:173:12)
    at process.<anonymous> (/home/pi/leds/node_modules/rpi-ws281x-native/examples/new-api.js:10:10)
    at emitNone (events.js:86:13)
    at process.emit (events.js:185:7)
    at Signal.wrap.onsignal (internal/process.js:217:44)

Also finalize() does a segmentation fault.

Any ideas ?

Thanks !

@natcl
Copy link
Contributor Author

natcl commented Mar 30, 2018

I fixed the first problem by changing this:

  [_reset]() {
    if (this.array) this.array.fill(0);
  }

The segmentation fault remains upon finalize though.

@riccardolardi
Copy link

Same problem here, .finalize() leads to segmentation fault, but weirdly only sometimes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants