}
wxRegionRefData(const wxRegionRefData& refData)
+ : wxObjectRefData()
{
#ifdef __WXGTK20__
m_region = gdk_region_copy(refData.m_region);
#define M_REGIONDATA ((wxRegionRefData *)m_refData)
#define M_REGIONDATA_OF(rgn) ((wxRegionRefData *)(rgn.m_refData))
-IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject);
-IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator,wxObject);
+IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
+IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator,wxObject)
// ----------------------------------------------------------------------------
// wxRegion construction
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()
{
- delete m_rects;
+ delete [] m_rects;
}
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;