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 @@ -326,8 +326,9 @@ inline Environment::~Environment() {
326
326
v8::HandleScope handle_scope (isolate ());
327
327
328
328
#if HAVE_INSPECTOR
329
- // Destroy inspector agent before erasing the context.
330
- delete inspector_agent_;
329
+ // Destroy inspector agent before erasing the context. The inspector
330
+ // destructor depends on the context still being accessible.
331
+ inspector_agent_.reset (nullptr );
331
332
#endif
332
333
333
334
context ()->SetAlignedPointerInEmbedderData (kContextEmbedderDataIndex ,
Original file line number Diff line number Diff line change @@ -689,7 +689,7 @@ class Environment {
689
689
690
690
#if HAVE_INSPECTOR
691
691
inline inspector::Agent* inspector_agent () const {
692
- return inspector_agent_;
692
+ return inspector_agent_. get () ;
693
693
}
694
694
#endif
695
695
@@ -734,7 +734,7 @@ class Environment {
734
734
std::map<std::string, uint64_t > performance_marks_;
735
735
736
736
#if HAVE_INSPECTOR
737
- inspector::Agent* const inspector_agent_;
737
+ std::unique_ptr< inspector::Agent> inspector_agent_;
738
738
#endif
739
739
740
740
HandleWrapQueue handle_wrap_queue_;
You can’t perform that action at this time.
0 commit comments