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:
@@ -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();
|
||||||
|
@@ -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();
|
||||||
|
@@ -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();
|
||||||
|
@@ -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();
|
||||||
|
@@ -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();
|
||||||
|
Reference in New Issue
Block a user