]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't create temporary file in wxDebugReport ctor.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 16 Mar 2013 17:27:31 +0000 (17:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 16 Mar 2013 17:27:31 +0000 (17:27 +0000)
Just use wxFileName::GetTempDir() instead of creating a file in the temporary
directory and then using its path.

Closes #15103.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/debugrpt.cpp

index d98c9cb044b855c784658ac98e2c9abb1454bd3e..3d4f5054127e99cff5ec86f94f00484a3450cb30 100644 (file)
@@ -188,16 +188,14 @@ wxDebugReport::wxDebugReport()
     // directory, so do our best to create a unique name ourselves
     //
     // of course, this doesn't protect us against malicious users...
-    wxFileName fn;
-    fn.AssignTempFileName(appname);
 #if wxUSE_DATETIME
     m_dir.Printf(wxT("%s%c%s_dbgrpt-%lu-%s"),
-                 fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(),
+                 wxFileName::GetTempDir(), wxFILE_SEP_PATH, appname,
                  wxGetProcessId(),
-                 wxDateTime::Now().Format(wxT("%Y%m%dT%H%M%S")).c_str());
+                 wxDateTime::Now().Format(wxT("%Y%m%dT%H%M%S")));
 #else
     m_dir.Printf(wxT("%s%c%s_dbgrpt-%lu"),
-                 fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(),
+                 wxFileName::GetTempDir(), wxFILE_SEP_PATH, appname,
                  wxGetProcessId());
 #endif