This makes it behaviour consistent with wxFile::Open().
Also don't use Detach() in Close(), again for consistency with wxFile, even if
this has no user-visible effects at all.
See #15494.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74799
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxFFile::wxFFile(const wxString& filename, const wxString& mode)
{
wxFFile::wxFFile(const wxString& filename, const wxString& mode)
{
(void)Open(filename, mode);
}
(void)Open(filename, mode);
}
{
wxASSERT_MSG( !m_fp, wxT("should close or detach the old file first") );
{
wxASSERT_MSG( !m_fp, wxT("should close or detach the old file first") );
- m_fp = wxFopen(filename, mode);
+ FILE* const fp = wxFopen(filename, mode);
{
wxLogSysError(_("can't open file '%s'"), filename);
return false;
}
{
wxLogSysError(_("can't open file '%s'"), filename);
return false;
}