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:
Vadim Zeitlin
2020-03-31 02:43:15 +02:00
parent 15b5a1865c
commit 06af121e9c
4 changed files with 28 additions and 14 deletions

View File

@@ -296,13 +296,12 @@ class MyGridCellAttrProvider : public wxGridCellAttrProvider
{
public:
MyGridCellAttrProvider();
virtual ~MyGridCellAttrProvider();
virtual wxGridCellAttr *GetAttr(int row, int col,
wxGridCellAttr::wxAttrKind kind) const wxOVERRIDE;
private:
wxGridCellAttr *m_attrForOddRows;
wxObjectDataPtr<wxGridCellAttr> m_attrForOddRows;
};
// ----------------------------------------------------------------------------