diff options
| author | Riccardo Spagni <ric@spagni.net> | 2015-12-31 12:43:15 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2015-12-31 12:43:15 +0200 |
| commit | ac7d27d4f94ddcaacd9eef563f8ff6d3e90fa12f (patch) | |
| tree | 42e653b2c119eda8b90097ebda958bc6ec2275f2 | |
| parent | 2f62e0c19d27d126ebac9048b092d479ca694261 (diff) | |
| parent | 5c67c486e866c9caaeeff4bd990600a91f5a246c (diff) | |
| download | monzero-core-ac7d27d4f94ddcaacd9eef563f8ff6d3e90fa12f.tar.gz monzero-core-ac7d27d4f94ddcaacd9eef563f8ff6d3e90fa12f.tar.xz monzero-core-ac7d27d4f94ddcaacd9eef563f8ff6d3e90fa12f.zip | |
Merge pull request #584
5c67c48 wallet: don't forget to close the file after storing cache (moneromooo-monero)
| -rw-r--r-- | src/wallet/wallet2.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 6fda19a42..bceea367f 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1305,9 +1305,11 @@ void wallet2::store() const std::string old_file = m_wallet_file + ".old"; // save to new file - std::ofstream ostr(new_file); + std::ofstream ostr; + ostr.open(new_file, std::ios_base::binary | std::ios_base::out | std::ios_base::trunc); binary_archive<true> oar(ostr); bool success = ::serialization::serialize(oar, cache_file_data); + ostr.close(); THROW_WALLET_EXCEPTION_IF(!success || !ostr.good(), error::file_save_error, new_file); // rename |
