From a470957ada116aebc37f00aa95d4e02274fb65d7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Aug 2008 23:58:24 +0000 Subject: [PATCH] fix fatal bug in wxVector copy ctor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/vector.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/wx/vector.h b/include/wx/vector.h index 85d9257..df49178 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -124,7 +124,7 @@ public: wxVector() : m_size(0), m_capacity(0), m_values(NULL) {} - wxVector(const wxVector& c) + wxVector(const wxVector& c) : m_size(0), m_capacity(0), m_values(NULL) { Copy(c); } @@ -144,7 +144,8 @@ public: Ops::Free(m_values); m_values = NULL; - m_size = m_capacity = 0; + m_size = + m_capacity = 0; } void reserve(size_type n) @@ -184,6 +185,7 @@ public: wxVector& operator=(const wxVector& vb) { + clear(); Copy(vb); return *this; } @@ -321,7 +323,6 @@ private: void Copy(const wxVector& vb) { - clear(); reserve(vb.size()); for ( const_iterator i = vb.begin(); i != vb.end(); ++i ) -- 2.7.4