X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3b4d71020dc67b8dd7ed772a303ec740064dd27..33754c4d83c59b7523a6da0c4fb21079cb60301c:/src/common/file.cpp

diff --git a/src/common/file.cpp b/src/common/file.cpp
index f76cdda441..e7834e082a 100644
--- a/src/common/file.cpp
+++ b/src/common/file.cpp
@@ -478,7 +478,7 @@ bool wxTempFile::Open(const wxString& strName)
 {
     m_strName = strName;
 
-    m_strTemp = wxFileName::CreateTempFileName(strName);
+    m_strTemp = wxFileName::CreateTempFileName(strName, &m_file);
 
     if ( m_strTemp.empty() )
     {
@@ -486,13 +486,6 @@ bool wxTempFile::Open(const wxString& strName)
         return FALSE;
     }
 
-    // actually open the file now (it must already exist)
-    if ( !m_file.Open(m_strTemp, wxFile::write) )
-    {
-        // opening existing file failed?
-        return FALSE;
-    }
-
 #ifdef __UNIX__
     // the temp file should have the same permissions as the original one
     mode_t mode;