Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

grgustaf
Copy link
Contributor

@grgustaf grgustaf commented Feb 1, 2018

Only one event callback was supposed to be created, but the line was
moved to zjs_make_emitter so that it was created for each new emitter
object. For tests that close and open sockets repeatedly, for example,
this eventually caused the system to run out of memory.

Fixes #1737

Signed-off-by: Geoff Gustafson geoff@linux.intel.com

Only one event callback was supposed to be created, but the line was
moved to zjs_make_emitter so that it was created for each new emitter
object. For tests that close and open sockets repeatedly, for example,
this eventually caused the system to run out of memory.

Fixes intel#1737

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
#define DEFAULT_MAX_LISTENERS 10

static jerry_value_t zjs_event_emitter_prototype = 0;
zjs_callback_id emit_id = -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making this global doesn't it mean that it can be overwritten with multiple events from different modules?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was already global... I just moved it up from down below because it's lifetime is now tied to that to that of the prototype defined just above.

However, it could probably be static...

@jimmy-huang
Copy link
Contributor

+1

@cuiyanx
Copy link
Contributor

cuiyanx commented Feb 1, 2018

Verified with commit d09e4b3 on master, the issue #1737 will be fixed.

@brianjjones
Copy link
Contributor

LGTM +1.

@jimmy-huang jimmy-huang merged commit 5182eb0 into intel:master Feb 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tcp] General Protection Fault occurs when running TCPEchoServ6.js on arduino101 over ble for long time

4 participants