From 2fe0ef8a1e4a61e3baab7f6e512b28543ad4c97c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 18 Jan 2002 20:31:40 +0000 Subject: [PATCH] fix for Sun CC bug with not calling temporary objects dtor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filefn.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 2539acd9ab..1c498fa3b0 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1474,7 +1474,13 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) wxString wxGetCwd() { wxString str; - wxGetWorkingDirectory(wxStringBuffer(str, _MAXPATHLEN), _MAXPATHLEN); + + // we can't create wxStringBuffer object inline: Sun CC generates buggy + // code in this case! + { + wxStringBuffer buf(str, _MAXPATHLEN); + wxGetWorkingDirectory(buf, _MAXPATHLEN); + } return str; }