add public wxObject::UnShare
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
// headers
|
// headers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/memory.h"
|
#include "wx/memory.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_BASE wxObject;
|
class WXDLLIMPEXP_BASE wxObject;
|
||||||
@@ -471,13 +470,16 @@ public:
|
|||||||
// destroy a reference
|
// destroy a reference
|
||||||
void UnRef();
|
void UnRef();
|
||||||
|
|
||||||
|
// Make sure this object has only one reference
|
||||||
|
void UnShare() { AllocExclusive(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ensure that our data is not shared with anybody else: if we have no
|
// ensure that our data is not shared with anybody else: if we have no
|
||||||
// data, it is created using CreateRefData() below, if we have shared data
|
// data, it is created using CreateRefData() below, if we have shared data
|
||||||
// it is copied using CloneRefData(), otherwise nothing is done
|
// it is copied using CloneRefData(), otherwise nothing is done
|
||||||
void AllocExclusive();
|
void AllocExclusive();
|
||||||
|
|
||||||
// both methods must be implemented if Unshare() is used, not pure virtual
|
// both methods must be implemented if AllocExclusive() is used, not pure virtual
|
||||||
// only because of the backwards compatibility reasons
|
// only because of the backwards compatibility reasons
|
||||||
|
|
||||||
// create a new m_refData
|
// create a new m_refData
|
||||||
|
Reference in New Issue
Block a user