File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525#include " env-inl.h"
2626#include " node_errors.h"
2727#include " node_external_reference.h"
28+ #ifdef DEBUG
29+ #include < node_process-inl.h>
30+ #endif
2831#include " tracing/traced_value.h"
2932#include " util-inl.h"
3033
@@ -338,8 +341,7 @@ void AsyncWrap::EmitDestroy(bool from_gc) {
338341 HandleScope handle_scope (env ()->isolate ());
339342 USE (object ()->Set (env ()->context (), env ()->resource_symbol (), object ()));
340343 }
341- Isolate* isolate = env ()->isolate ();
342- context_frame_.Reset (isolate, Undefined (isolate));
344+ context_frame_.Reset ();
343345 }
344346}
345347
@@ -663,7 +665,14 @@ MaybeLocal<Value> AsyncWrap::MakeCallback(const Local<Function> cb,
663665 Local<Value>* argv) {
664666 EmitTraceEventBefore ();
665667
666- DCHECK (!context_frame_.IsEmpty ());
668+ #ifdef DEBUG
669+ if (context_frame_.IsEmpty ()) {
670+ ProcessEmitWarning (env (),
671+ " MakeCallback() called without context_frame, "
672+ " likely use after destroy of AsyncWrap." );
673+ }
674+ #endif
675+
667676 ProviderType provider = provider_type ();
668677 async_context context { get_async_id (), get_trigger_async_id () };
669678 MaybeLocal<Value> ret =
You can’t perform that action at this time.
0 commit comments