Skip to content

Commit 44ee842

Browse files
committed
add missing delete function for inspector session
1 parent 31cc22c commit 44ee842

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/binding.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ v8::Platform* v8__Platform__NewDefaultPlatform(
104104
int thread_pool_size,
105105
bool idle_task_support) {
106106
return v8::platform::NewDefaultPlatform(
107-
thread_pool_size,
107+
thread_pool_size,
108108
idle_task_support ? v8::platform::IdleTaskSupport::kEnabled : v8::platform::IdleTaskSupport::kDisabled,
109109
v8::platform::InProcessStackDumping::kDisabled,
110110
nullptr
@@ -1614,6 +1614,10 @@ void v8_inspector__Inspector__ContextCreated(v8_inspector::V8Inspector *self,
16141614

16151615
// InspectorSession
16161616

1617+
void v8_inspector__Session__DELETE(v8_inspector::V8InspectorSession* self) {
1618+
delete self;
1619+
}
1620+
16171621
void v8_inspector__Session__dispatchProtocolMessage(
16181622
v8_inspector::V8InspectorSession *session, v8::Isolate *isolate,
16191623
const char *msg, int msg_len) {

src/binding.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ bool v8__TryCatch__HasCaught(const TryCatch* self);
298298
const Value* v8__TryCatch__StackTrace(const TryCatch* self, const Context* context);
299299
bool v8__TryCatch__IsVerbose(const TryCatch* self);
300300
void v8__TryCatch__SetVerbose(
301-
TryCatch* self,
301+
TryCatch* self,
302302
bool value);
303303
const Value* v8__TryCatch__ReThrow(TryCatch* self);
304304

@@ -568,7 +568,7 @@ int64_t v8__Integer__Value(const Integer* self);
568568

569569
// BigInt
570570
const BigInt* v8__BigInt__New(
571-
Isolate* iso,
571+
Isolate* iso,
572572
int64_t val);
573573
const BigInt* v8__BigInt__NewFromUnsigned(
574574
Isolate* iso,
@@ -697,7 +697,7 @@ void v8__Function__SetName(const Function* self, const String* name);
697697

698698
// External
699699
const External* v8__External__New(
700-
Isolate* isolate,
700+
Isolate* isolate,
701701
void* value);
702702
void* v8__External__Value(
703703
const External* self);
@@ -992,6 +992,7 @@ const Context* v8_inspector__Client__IMPL__ensureDefaultContextInGroup(
992992
// InspectorSession
993993

994994
typedef struct InspectorSession InspectorSession;
995+
void v8_inspector__Session__DELETE(Inspector *self);
995996
void v8_inspector__Session__dispatchProtocolMessage(InspectorSession *session, Isolate *isolate, const char* msg, usize msg_len);
996997

997998
// Inspector

src/v8.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,6 +2632,10 @@ pub export fn v8_inspector__Channel__IMPL__flushProtocolNotifications(
26322632
pub const InspectorSession = struct {
26332633
handle: *c.InspectorSession,
26342634

2635+
pub fn deinit(self: InspectorSession) void {
2636+
c.v8_inspector__Session__DELETE(self.handle);
2637+
}
2638+
26352639
pub fn dispatchProtocolMessage(
26362640
self: InspectorSession,
26372641
isolate: Isolate,

0 commit comments

Comments
 (0)