File tree 2 files changed +5
-4
lines changed 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -347,8 +347,9 @@ inline Environment::~Environment() {
347
347
v8::HandleScope handle_scope (isolate ());
348
348
349
349
#if HAVE_INSPECTOR
350
- // Destroy inspector agent before erasing the context.
351
- delete inspector_agent_;
350
+ // Destroy inspector agent before erasing the context. The inspector
351
+ // destructor depends on the context still being accessible.
352
+ inspector_agent_.reset (nullptr );
352
353
#endif
353
354
354
355
context ()->SetAlignedPointerInEmbedderData (kContextEmbedderDataIndex ,
Original file line number Diff line number Diff line change @@ -673,7 +673,7 @@ class Environment {
673
673
674
674
#if HAVE_INSPECTOR
675
675
inline inspector::Agent* inspector_agent () const {
676
- return inspector_agent_;
676
+ return inspector_agent_. get () ;
677
677
}
678
678
#endif
679
679
@@ -718,7 +718,7 @@ class Environment {
718
718
std::map<std::string, uint64_t > performance_marks_;
719
719
720
720
#if HAVE_INSPECTOR
721
- inspector::Agent* const inspector_agent_;
721
+ std::unique_ptr< inspector::Agent> inspector_agent_;
722
722
#endif
723
723
724
724
HandleWrapQueue handle_wrap_queue_;
You can’t perform that action at this time.
0 commit comments