Skip to content

Commit 1317687

Browse files
committed
Fix callback rejections
1 parent f9104e4 commit 1317687

4 files changed

Lines changed: 6 additions & 0 deletions

File tree

generate/templates/templates/class_content.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ using namespace node;
5353
{% endif %}
5454
{% endeach %}
5555

56+
this->callbackError->Reset();
57+
5658
}
5759

5860
void {{ cppClassName }}::InitializeComponent(Local<v8::Object> target) {

generate/templates/templates/class_header.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ class {{ cppClassName }} : public Nan::ObjectWrap {
176176
{%if cType%}
177177
{{ cType }} *raw;
178178
{%endif%}
179+
Nan::Persistent<v8::Value> callbackError;
179180
};
180181

181182
#endif

generate/templates/templates/struct_content.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ using namespace std;
5858
{% endif %}
5959
{% endeach %}
6060

61+
this->callbackError->Reset();
62+
6163
if (this->selfFreeing) {
6264
free(this->raw);
6365
}

generate/templates/templates/struct_header.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class {{ cppClassName }} : public Nan::ObjectWrap {
8888
{% endeach %}
8989

9090
{{ cType }} *raw;
91+
Nan::Persistent<v8::Value> callbackError;
9192
};
9293

9394
#endif

0 commit comments

Comments
 (0)