mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Close input stream too
This commit is contained in:
parent
846e550c4f
commit
4564776733
1 changed files with 1 additions and 1 deletions
|
|
@ -65,7 +65,7 @@ bool ProtobufHelpers::LoadOnnxTensorFromProtobufFile(onnx::TensorProto& tensor,
|
|||
google::protobuf::io::FileInputStream input(fd, block_size);
|
||||
const bool result = tensor.ParseFromZeroCopyStream(&input) && input.GetErrno() == 0;
|
||||
status = onnxruntime::Env::Default().FileClose(fd);
|
||||
if (!result || !status.IsOK()) {
|
||||
if (!result || !status.IsOK() || !input.Close()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue