X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ef5b1dad1f5d18309d0fdc0b36ad383b58f1a2e..7198c3368055d88249a338eb33b21f051f674806:/src/dfb/cursor.cpp diff --git a/src/dfb/cursor.cpp b/src/dfb/cursor.cpp index 9d9bf2e850..e013a91295 100644 --- a/src/dfb/cursor.cpp +++ b/src/dfb/cursor.cpp @@ -30,6 +30,15 @@ public: virtual bool IsOk() const { return m_bitmap.IsOk(); } + // Create a deep copy of this object. + wxCursorRefData *Clone() const + { + wxBitmap bitmapCopy(m_bitmap); + bitmapCopy.UnShare(); + + return new wxCursorRefData(bitmapCopy, m_id); + } + int m_id; wxBitmap m_bitmap; }; @@ -62,7 +71,7 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxCursorRefData(*(wxCursorRefData *)data); + return static_cast(data)->Clone(); }