mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2024-12-12 19:18:24 +02:00
7763c98188
The primary motivation for this commit was rust-lang/cargo#4189 where dropping a `wincolor::Console` would call `CloseHandle` to close the console handle. Cargo creates a few `Console` instances so it ended up closing stdout a little earlier as intended! The `GetStdHandle` function returns handles I believe aren't intended to be closed (as there's no refcounting). I believe libstd doesn't close these handles. This commit also moves to calling `GetStdHandle` on demand which libstd changed to doing so recently as well, preventing caching of stale handles that change over time with calls to `SetStdHandle`. |
||
---|---|---|
.. | ||
lib.rs | ||
win.rs |