]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed SetAddress() for self-assignment (patch 1430703)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 13 Feb 2006 15:16:37 +0000 (15:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 13 Feb 2006 15:16:37 +0000 (15:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/sckaddr.cpp

index 86a440f0090f2f31f5614dc120363879ec4de02d..b8a96b2f5f471afa902555a560147459973fe123 100644 (file)
@@ -82,8 +82,11 @@ wxSockAddress::~wxSockAddress()
 
 void wxSockAddress::SetAddress(GAddress *address)
 {
-  GAddress_destroy(m_address);
-  m_address = GAddress_copy(address);
+    if ( address != m_address )
+    {
+        GAddress_destroy(m_address);
+        m_address = GAddress_copy(address);
+    }
 }
 
 wxSockAddress& wxSockAddress::operator=(const wxSockAddress& addr)