File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ inline Environment::Environment(IsolateData* isolate_data,
306
306
emit_napi_warning_(true ),
307
307
makecallback_cntr_(0 ),
308
308
#if HAVE_INSPECTOR
309
- inspector_agent_ (this ),
309
+ inspector_agent_ (new inspector::Agent( this ) ),
310
310
#endif
311
311
handle_cleanup_waiting_ (0 ),
312
312
http_parser_buffer_(nullptr ),
@@ -347,6 +347,11 @@ inline Environment::Environment(IsolateData* isolate_data,
347
347
inline Environment::~Environment () {
348
348
v8::HandleScope handle_scope (isolate ());
349
349
350
+ #if HAVE_INSPECTOR
351
+ // Destroy inspector agent before erasing the context.
352
+ delete inspector_agent_;
353
+ #endif
354
+
350
355
context ()->SetAlignedPointerInEmbedderData (kContextEmbedderDataIndex ,
351
356
nullptr );
352
357
#define V (PropertyName, TypeName ) PropertyName ## _.Reset();
Original file line number Diff line number Diff line change @@ -668,8 +668,8 @@ class Environment {
668
668
#undef V
669
669
670
670
#if HAVE_INSPECTOR
671
- inline inspector::Agent* inspector_agent () {
672
- return & inspector_agent_;
671
+ inline inspector::Agent* inspector_agent () const {
672
+ return inspector_agent_;
673
673
}
674
674
#endif
675
675
@@ -714,7 +714,7 @@ class Environment {
714
714
std::map<std::string, uint64_t > performance_marks_;
715
715
716
716
#if HAVE_INSPECTOR
717
- inspector::Agent inspector_agent_;
717
+ inspector::Agent* const inspector_agent_;
718
718
#endif
719
719
720
720
HandleWrapQueue handle_wrap_queue_;
You can’t perform that action at this time.
0 commit comments