Fix memory leak when using custom renderers in wxOSX wxDataViewCtrl.

wxDataViewRendererNativeData retains a reference to the cell passed to it, so
the cell must be released after passing it to wxDataViewRendererNativeData to
avoid leaking it.

Closes #16226.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-06-01 16:22:18 +00:00
parent 4f3b27e89a
commit 22f0aa4c3e

View File

@@ -2755,7 +2755,9 @@ wxDataViewCustomRenderer::wxDataViewCustomRenderer(const wxString& varianttype,
m_editorCtrlPtr(NULL),
m_DCPtr(NULL)
{
SetNativeData(new wxDataViewRendererNativeData([[wxCustomCell alloc] init]));
wxCustomCell* cell = [[wxCustomCell alloc] init];
SetNativeData(new wxDataViewRendererNativeData(cell));
[cell release];
}
bool wxDataViewCustomRenderer::MacRender()