Add wxObjectDataPtr::release()
This makes it possible to use wxObjectDataPtr inside functions returning raw pointers owned by the caller, such as custom GetAttr() in the grid sample.
This commit is contained in:
@@ -313,6 +313,13 @@ public:
|
||||
m_ptr = ptr;
|
||||
}
|
||||
|
||||
T* release()
|
||||
{
|
||||
T* const ptr = m_ptr;
|
||||
m_ptr = NULL;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
wxObjectDataPtr& operator=(const wxObjectDataPtr &tocopy)
|
||||
{
|
||||
if (m_ptr)
|
||||
|
Reference in New Issue
Block a user