I noticed that at this line it is possible for HandleProgressCallback to be called with NULL, if coming into this function asyncdata_ == NULL then it will be copied to data, and then passed into HandleProgressCallback() (the delete[] data a few lines later will pass (if it gets there, but I got an access violation before that happened :-( ).
I caught this in VS 2015 debugger by setting a conditional breakpoint where data == null
I've added some protective code in my HandleProgressCallback, but thought you might want to consider guarding against it in WorkProgress(), I think (not 100% sure) it happens just before HandleOKCallback() would be called.
Here's my HandleProgressCallback() for reference
void StlWorker::HandleProgressCallback(const char *data, size_t size) {
Nan::HandleScope scope;
if (m_progress && data) { // Need to check data for non-NULL (which we can be called with)
int progress = *reinterpret_cast<int*>(const_cast<char*>(data));
v8::Local<v8::Value> argv[] = {
New<v8::Integer>(progress)
};
m_progress->Call(1, argv);
}
}
I noticed that at this line it is possible for
HandleProgressCallbackto be called with NULL, if coming into this functionasyncdata_ == NULLthen it will be copied to data, and then passed intoHandleProgressCallback()(thedelete[] dataa few lines later will pass (if it gets there, but I got an access violation before that happened :-( ).I caught this in VS 2015 debugger by setting a conditional breakpoint where data == null
I've added some protective code in my HandleProgressCallback, but thought you might want to consider guarding against it in
WorkProgress(), I think (not 100% sure) it happens just before HandleOKCallback() would be called.Here's my HandleProgressCallback() for reference