-
-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Issue 24165 - Failed readf leaves File in inconsistent state
Previously, a failed call to readf resulted in multiple copies of the same LockingTextWriter being destroyed. Since LockingTextWriter's destructor calls ungetc on the last-read character, this caused that character to appear multiple times in subsequent reads from the File. This change ensures that the destructor in question is only run once by making LockingTextWriter a reference-counted type. Ideally, to avoid unnecessary overhead, this issue would have been fixed by making LockingTextWriter non-copyable. However, non-copyable ranges are poorly-supported by Phobos, and this approach would have required extensive changes to several other modules, including changes to the interfaces of some public symbols.
- Loading branch information
Showing
1 changed file
with
100 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters