fix for assert when copying bitmap in CloneRefData()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -264,7 +264,6 @@ wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *dataOrig) const
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wxBitmap *self = wx_const_cast(wxBitmap *, this);
|
wxBitmap *self = wx_const_cast(wxBitmap *, this);
|
||||||
self->m_refData = new wxBitmapRefData(*data);
|
|
||||||
|
|
||||||
#if wxUSE_WXDIB
|
#if wxUSE_WXDIB
|
||||||
// copy the other bitmap
|
// copy the other bitmap
|
||||||
@@ -273,7 +272,12 @@ wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *dataOrig) const
|
|||||||
wxDIB dib((HBITMAP)(data->m_hBitmap));
|
wxDIB dib((HBITMAP)(data->m_hBitmap));
|
||||||
self->CopyFromDIB(dib);
|
self->CopyFromDIB(dib);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
#endif // wxUSE_WXDIB
|
#endif // wxUSE_WXDIB
|
||||||
|
{
|
||||||
|
// don't copy the bitmap data, but do copy the size, depth, ...
|
||||||
|
self->m_refData = new wxBitmapRefData(*data);
|
||||||
|
}
|
||||||
|
|
||||||
return m_refData;
|
return m_refData;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user