Don't leak wxDataViewCtrl column objects in wxOSX/Cocoa.

NSOutlineView addTableColumn method takes ownership of the column passed to
it, so we must release it ourselves to avoid leaking it.

Closes #16223.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-06-01 16:23:19 +00:00
parent 10b7d587fa
commit afae016fca

View File

@ -2045,6 +2045,10 @@ bool wxCocoaDataViewControl::InsertColumn(unsigned int pos, wxDataViewColumn* co
// specified position the column is first appended and - if necessary -
// moved to its final position:
[m_OutlineView addTableColumn:nativeColumn];
// it is owned, and kepy alive, by m_OutlineView now
[nativeColumn release];
if (pos != static_cast<unsigned int>([m_OutlineView numberOfColumns]-1))
[m_OutlineView moveColumn:[m_OutlineView numberOfColumns]-1 toColumn:pos];