don't create new refdata unnecessarily in Unshare()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2007-03-11 02:29:49 +00:00
parent 17df84c821
commit 4a2dbb5fb1
5 changed files with 5 additions and 5 deletions

View File

@@ -129,7 +129,7 @@ void wxBrush::Unshare()
{ {
m_refData = new wxBrushRefData(); m_refData = new wxBrushRefData();
} }
else else if (m_refData->GetRefCount() > 1)
{ {
wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData); wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData);
UnRef(); UnRef();

View File

@@ -456,7 +456,7 @@ void wxFont::Unshare()
{ {
m_refData = new wxFontRefData(); m_refData = new wxFontRefData();
} }
else else if (m_refData->GetRefCount() > 1)
{ {
wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData); wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData);
UnRef(); UnRef();

View File

@@ -93,7 +93,7 @@ void wxPen::Unshare()
{ {
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
} }
else else if (m_refData->GetRefCount() > 1)
{ {
wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData); wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData);
UnRef(); UnRef();

View File

@@ -903,7 +903,7 @@ void wxFont::Unshare()
{ {
m_refData = new wxFontRefData(); m_refData = new wxFontRefData();
} }
else else if (m_refData->GetRefCount() > 1)
{ {
wxFontRefData* ref = new wxFontRefData(*M_FONTDATA); wxFontRefData* ref = new wxFontRefData(*M_FONTDATA);
UnRef(); UnRef();

View File

@@ -277,7 +277,7 @@ void wxPen::Unshare()
{ {
m_refData = new wxPenRefData(); m_refData = new wxPenRefData();
} }
else else if (m_refData->GetRefCount() > 1)
{ {
wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData); wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData);
UnRef(); UnRef();