block: only free the descriptor once
This commit is contained in:
parent
b8d5546db2
commit
62bcb951b8
1 changed files with 5 additions and 3 deletions
|
@ -107,10 +107,12 @@ pub fn Block(
|
||||||
fn descDisposeHelper(src: *anyopaque) callconv(.C) void {
|
fn descDisposeHelper(src: *anyopaque) callconv(.C) void {
|
||||||
const real_src: *Context = @ptrCast(@alignCast(src));
|
const real_src: *Context = @ptrCast(@alignCast(src));
|
||||||
inline for (captures_info.fields) |field| {
|
inline for (captures_info.fields) |field| {
|
||||||
if (field.type == objc.c.id) _Block_object_dispose(@field(real_src, field.name), 3);
|
if (field.type == objc.c.id) {
|
||||||
alloc.free(std.mem.sliceTo(@field(@field(real_src, "descriptor"), "signature").?, 0));
|
_Block_object_dispose(@field(real_src, field.name), 3);
|
||||||
alloc.destroy(@field(real_src, "descriptor"));
|
}
|
||||||
}
|
}
|
||||||
|
alloc.free(std.mem.sliceTo(real_src.descriptor.signature.?, 0));
|
||||||
|
alloc.destroy(real_src.descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a function type for the invocation function, but alters
|
/// Creates a function type for the invocation function, but alters
|
||||||
|
|
Loading…
Add table
Reference in a new issue