Check for self-assignment in wxFileName::operator=().
This is a backport of r56794 from trunk but adds the check for self-assignment to the Assign() implementation which is in a .cpp file and so is compiled into the library and not operator=() itself which is inlined to avoid any problems with mixing different version of this inline function when updating to next 2.8 version without recompiling. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@61943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -305,6 +305,9 @@ static bool IsUNCPath(const wxString& path, wxPathFormat format)
|
||||
|
||||
void wxFileName::Assign( const wxFileName &filepath )
|
||||
{
|
||||
if ( &filepath == this )
|
||||
return;
|
||||
|
||||
m_volume = filepath.GetVolume();
|
||||
m_dirs = filepath.GetDirs();
|
||||
m_name = filepath.GetName();
|
||||
|
Reference in New Issue
Block a user