- return new wxBrushRefData;
-}
-
-wxObjectRefData* wxBrush::CloneRefData(const wxObjectRefData* data) const
-{
- return new wxBrushRefData(*wx_static_cast(const wxBrushRefData*, data));
+ // Don't change shared data
+ if (!m_refData)
+ {
+ m_refData = new wxBrushRefData();
+ }
+ else
+ {
+ wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData);
+ UnRef();
+ m_refData = ref;
+ }