Skip to content

Commit

Permalink
cgen: always free the allocated consts, in the generated _vcleanup() …
Browse files Browse the repository at this point in the history
…function
  • Loading branch information
spytheman committed Dec 9, 2023
1 parent 08189d6 commit d1e31e5
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 80 deletions.
3 changes: 2 additions & 1 deletion vlib/net/http/request.v
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ pub mut:
on_finish RequestFinishFn = unsafe { nil }
}

fn (mut req Request) free() {
@[unsafe]
pub fn (mut req Request) free() {
unsafe { req.header.free() }
}

Expand Down
3 changes: 2 additions & 1 deletion vlib/net/http/response.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ pub mut:
http_version string
}

fn (mut resp Response) free() {
@[unsafe]
pub fn (mut resp Response) free() {
unsafe { resp.header.free() }
}

Expand Down
Loading

0 comments on commit d1e31e5

Please sign in to comment.