One might assume (as I did) that CAutoFile would be ref-counted so that a copied object would delay closing the underlying file until all copies have gone out of scope. Since that's not the case with CAutoFile, explicitly disable copying.
Disallow by-value copies of CAutoFile #4986
pull theuni wants to merge 2 commits into bitcoin:master from theuni:nofilecopy changing 5 files +13 −9-
theuni commented at 11:26 PM on September 25, 2014: member
-
autofile: don't copy CAutoFile by value eee030f6bc
- theuni force-pushed on Sep 25, 2014
-
in src/serialize.h:None in 485f4b7c4d outdated
1161 | @@ -1162,6 +1162,10 @@ class CDataStream 1162 | */ 1163 | class CAutoFile 1164 | { 1165 | +private: 1166 | + // Disallow copies 1167 | + CAutoFile(const CAutoFile& lhs);
Diapolo commented at 6:52 AM on September 26, 2014:Nit/Question: Wouldn't that better be rhs?
theuni commented at 5:14 PM on September 26, 2014:Heh, yes, thanks. Even better to just drop the param name since it's unused anyway. I'll make the change.
laanwj commented at 7:21 AM on September 26, 2014: memberGood good. ACK.
6eb67b0ed2autofile: Disallow by-value copies of CAutoFile
One might assume that CAutoFile would be ref-counted so that a copied object would delay closing the underlying file until all copies have gone out of scope. Since that's not the case with CAutoFile, explicitly disable copying.
sipa commented at 5:32 PM on September 26, 2014: memberutACK
theuni force-pushed on Sep 26, 2014BitcoinPullTester commented at 6:07 PM on September 26, 2014: noneAutomatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4986_6eb67b0ed2b350b772f7edb67aee1bcf09c91b0b/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
sipa merged this on Sep 26, 2014sipa closed this on Sep 26, 2014sipa referenced this in commit 64cfaf891f on Sep 26, 2014MarcoFalke locked this on Sep 8, 2021Contributors
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 15:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 15:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me