]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed double deletion in region iterator
authorJulian Smart <julian@anthemion.co.uk>
Tue, 14 May 2002 15:49:35 +0000 (15:49 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 14 May 2002 15:49:35 +0000 (15:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/region.cpp
src/mac/region.cpp

index 16d033004c1cb9ce278570dd0b1b27cc90ececd6..c8ffc4632bbc1f82d4e4ec8e9c1a8f8345932aa3 100644 (file)
@@ -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)
index 16d033004c1cb9ce278570dd0b1b27cc90ececd6..c8ffc4632bbc1f82d4e4ec8e9c1a8f8345932aa3 100644 (file)
@@ -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)