mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-05 19:00:32 -05:00
fix issue for 4.04
This commit is contained in:
parent
4138b1885a
commit
0adebc304b
1 changed files with 8 additions and 1 deletions
|
|
@ -41,4 +41,11 @@ let release_ self x : unit =
|
||||||
|
|
||||||
let with_resource (self : _ t) f =
|
let with_resource (self : _ t) f =
|
||||||
let x = acquire_ self in
|
let x = acquire_ self in
|
||||||
Fun.protect ~finally:(fun () -> release_ self x) (fun () -> f x)
|
try
|
||||||
|
let res = f x in
|
||||||
|
release_ self x;
|
||||||
|
res
|
||||||
|
with e ->
|
||||||
|
let bt = Printexc.get_raw_backtrace () in
|
||||||
|
release_ self x;
|
||||||
|
Printexc.raise_with_backtrace e bt
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue