From 9e2fc7f4ddba14b1e7123d1654b385b21c71c744 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 28 Oct 2025 22:45:21 -0500 Subject: [PATCH] Common/IOFile: Remove the `Duplicate` function. The duplicate handles shared a read/write position making them effectively not thread-safe. --- Source/Core/Common/IOFile.cpp | 9 --------- Source/Core/Common/IOFile.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/Source/Core/Common/IOFile.cpp b/Source/Core/Common/IOFile.cpp index cc22979bbef..cf7762ea680 100644 --- a/Source/Core/Common/IOFile.cpp +++ b/Source/Core/Common/IOFile.cpp @@ -101,15 +101,6 @@ bool IOFile::Close() return m_good; } -IOFile IOFile::Duplicate(const char openmode[]) const -{ -#ifdef _WIN32 - return IOFile(_fdopen(_dup(_fileno(m_file)), openmode)); -#else // _WIN32 - return IOFile(fdopen(dup(fileno(m_file)), openmode)); -#endif // _WIN32 -} - void IOFile::SetHandle(std::FILE* file) { Close(); diff --git a/Source/Core/Common/IOFile.h b/Source/Core/Common/IOFile.h index 2aeff1916b8..187cbee4cfb 100644 --- a/Source/Core/Common/IOFile.h +++ b/Source/Core/Common/IOFile.h @@ -51,8 +51,6 @@ public: SharedAccess sh = SharedAccess::Default); bool Close(); - IOFile Duplicate(const char openmode[]) const; - template requires(std::is_trivially_copyable_v) bool ReadArray(T* elements, size_t count, size_t* num_read = nullptr)