[bugfix] port leaks
This commit is contained in:
parent
8e90517224
commit
8b550de06a
|
@ -22,7 +22,13 @@ pic_load_cstr(pic_state *pic, const char *src)
|
|||
{
|
||||
struct pic_port *port = pic_open_input_string(pic, src);
|
||||
|
||||
pic_try {
|
||||
pic_load_port(pic, port);
|
||||
}
|
||||
pic_catch {
|
||||
pic_close_port(pic, port);
|
||||
pic_raise(pic, pic->err);
|
||||
}
|
||||
|
||||
pic_close_port(pic, port);
|
||||
}
|
||||
|
|
|
@ -881,7 +881,13 @@ pic_read_cstr(pic_state *pic, const char *str)
|
|||
struct pic_port *port = pic_open_input_string(pic, str);
|
||||
pic_value form;
|
||||
|
||||
pic_try {
|
||||
form = pic_read(pic, port);
|
||||
}
|
||||
pic_catch {
|
||||
pic_close_port(pic, port);
|
||||
pic_raise(pic, pic->err);
|
||||
}
|
||||
|
||||
pic_close_port(pic, port);
|
||||
|
||||
|
|
Loading…
Reference in New Issue