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 @@ -354,8 +354,9 @@ inline Environment::~Environment() {
354
354
v8::HandleScope handle_scope (isolate ());
355
355
356
356
#if HAVE_INSPECTOR
357
- // Destroy inspector agent before erasing the context.
358
- delete inspector_agent_;
357
+ // Destroy inspector agent before erasing the context. The inspector
358
+ // destructor depends on the context still being accessible.
359
+ inspector_agent_.reset (nullptr );
359
360
#endif
360
361
361
362
context ()->SetAlignedPointerInEmbedderData (kContextEmbedderDataIndex ,
Original file line number Diff line number Diff line change @@ -670,7 +670,7 @@ class Environment {
670
670
671
671
#if HAVE_INSPECTOR
672
672
inline inspector::Agent* inspector_agent () const {
673
- return inspector_agent_;
673
+ return inspector_agent_. get () ;
674
674
}
675
675
#endif
676
676
@@ -715,7 +715,7 @@ class Environment {
715
715
std::map<std::string, uint64_t > performance_marks_;
716
716
717
717
#if HAVE_INSPECTOR
718
- inspector::Agent* const inspector_agent_;
718
+ std::unique_ptr< inspector::Agent> inspector_agent_;
719
719
#endif
720
720
721
721
HandleWrapQueue handle_wrap_queue_;
You can’t perform that action at this time.
0 commit comments