From 2012e3ea0f59ad68e129331d4853697b0efd9a3e Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 14 May 2002 15:49:35 +0000 Subject: [PATCH] Fixed double deletion in region iterator git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/region.cpp | 9 ++++++++- src/mac/region.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/mac/carbon/region.cpp b/src/mac/carbon/region.cpp index 16d033004c..c8ffc4632b 100644 --- a/src/mac/carbon/region.cpp +++ b/src/mac/carbon/region.cpp @@ -310,8 +310,15 @@ wxRegionIterator::wxRegionIterator(const wxRegionIterator& iterator) : wxObject() , m_current(iterator.m_current) , m_numRects(iterator.m_numRects) - , m_rects(iterator.m_rects) + , m_rects(NULL) { + int i; + if (iterator.m_rects) + { + m_rects = new wxRect[iterator.m_numRects]; + for (i = 0; i < iterator.m_numRects; i++) + m_rects[i] = iterator.m_rects[i]; + } } wxRegionIterator& wxRegionIterator::operator=(const wxRegionIterator& iterator) diff --git a/src/mac/region.cpp b/src/mac/region.cpp index 16d033004c..c8ffc4632b 100644 --- a/src/mac/region.cpp +++ b/src/mac/region.cpp @@ -310,8 +310,15 @@ wxRegionIterator::wxRegionIterator(const wxRegionIterator& iterator) : wxObject() , m_current(iterator.m_current) , m_numRects(iterator.m_numRects) - , m_rects(iterator.m_rects) + , m_rects(NULL) { + int i; + if (iterator.m_rects) + { + m_rects = new wxRect[iterator.m_numRects]; + for (i = 0; i < iterator.m_numRects; i++) + m_rects[i] = iterator.m_rects[i]; + } } wxRegionIterator& wxRegionIterator::operator=(const wxRegionIterator& iterator) -- 2.45.2