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