From 3f0fb1d4165f622ab392a28c1a08a975aa7c5378 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 4 May 2002 12:01:37 +0000 Subject: [PATCH] no changes (0 -> NULL) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/region.cpp | 18 +++++++++--------- src/gtk1/region.cpp | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index f184e4d795..fee7f0eb26 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -470,14 +470,15 @@ struct _XRegion { class wxRIRefData: public wxObjectRefData { public: + wxRIRefData() { Init(); } + virtual ~wxRIRefData(); - wxRIRefData() : m_rects(0), m_numRects(0){} - ~wxRIRefData(); + void CreateRects( const wxRegion& r ); + + void Init() { m_rects = NULL; m_numRects = 0; } wxRect *m_rects; size_t m_numRects; - - void CreateRects( const wxRegion& r ); }; wxRIRefData::~wxRIRefData() @@ -487,14 +488,13 @@ wxRIRefData::~wxRIRefData() void wxRIRefData::CreateRects( const wxRegion& region ) { - if (m_rects) - delete m_rects; + delete m_rects; - m_rects = 0; - m_numRects = 0; + Init(); GdkRegion *gdkregion = region.GetRegion(); - if (!gdkregion) return; + if (!gdkregion) + return; #ifdef __WXGTK20__ GdkRectangle *gdkrects = NULL; diff --git a/src/gtk1/region.cpp b/src/gtk1/region.cpp index f184e4d795..fee7f0eb26 100644 --- a/src/gtk1/region.cpp +++ b/src/gtk1/region.cpp @@ -470,14 +470,15 @@ struct _XRegion { class wxRIRefData: public wxObjectRefData { public: + wxRIRefData() { Init(); } + virtual ~wxRIRefData(); - wxRIRefData() : m_rects(0), m_numRects(0){} - ~wxRIRefData(); + void CreateRects( const wxRegion& r ); + + void Init() { m_rects = NULL; m_numRects = 0; } wxRect *m_rects; size_t m_numRects; - - void CreateRects( const wxRegion& r ); }; wxRIRefData::~wxRIRefData() @@ -487,14 +488,13 @@ wxRIRefData::~wxRIRefData() void wxRIRefData::CreateRects( const wxRegion& region ) { - if (m_rects) - delete m_rects; + delete m_rects; - m_rects = 0; - m_numRects = 0; + Init(); GdkRegion *gdkregion = region.GetRegion(); - if (!gdkregion) return; + if (!gdkregion) + return; #ifdef __WXGTK20__ GdkRectangle *gdkrects = NULL; -- 2.49.0