| ... | ... | @@ -336,6 +336,10 @@ pub const Response = struct { |
| 336 | 336 | headers: http.Headers, |
| 337 | 337 | request: Request, |
| 338 | 338 | |
| 339 | pub fn deinit(res: *Response) void { |
| 340 | res.server.allocator.destroy(res); |
| 341 | } |
| 342 | |
| 339 | 343 | /// Reset this response to its initial state. This must be called before handling a second request on the same connection. |
| 340 | 344 | pub fn reset(res: *Response) void { |
| 341 | 345 | res.request.headers.deinit(); |
| ... | ... | @@ -359,8 +363,6 @@ pub const Response = struct { |
| 359 | 363 | if (res.request.parser.header_bytes_owned) { |
| 360 | 364 | res.request.parser.header_bytes.deinit(res.server.allocator); |
| 361 | 365 | } |
| 362 | | |
| 363 | | res.server.allocator.destroy(res); |
| 364 | 366 | } else { |
| 365 | 367 | res.request.parser.reset(); |
| 366 | 368 | } |