Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Problem: handle file close logic #679

Merged
merged 5 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (rpc) [tharsis#661](https://github.com/tharsis/ethermint/pull/661) Fix OOM bug when creating too many filters using JSON-RPC.
* (evm) [tharsis#660](https://github.com/tharsis/ethermint/pull/660) Fix `nil` pointer panic in `ApplyNativeMessage`.

### Improvements

(rpc) [tharsis#679](https://github.com/tharsis/ethermint/pull/679) Fix file close handle.

## [v0.7.0] - 2021-10-07

### API Breaking
Expand Down
8 changes: 6 additions & 2 deletions rpc/ethereum/namespaces/debug/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ func writeProfile(name, file string, log log.Logger) error {
if err != nil {
return err
}
defer f.Close()

return p.WriteTo(f, 0)
if err := p.WriteTo(f, 0); err != nil {
f.Close()
return err
}

return f.Close()
}