Add wxItemContainer::DetachClientObject() and use it in wxRearrangeList.
Add a method to detach the item from an item control without deleting it and use it in wxRearrangeList to correctly swap object client data without deleting the pointers in the process. Closes #12201. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -150,8 +150,8 @@ void wxRearrangeList::Swap(int pos1, int pos2)
|
||||
|
||||
case wxClientData_Object:
|
||||
{
|
||||
wxClientData * const dataTmp = GetClientObject(pos1);
|
||||
SetClientObject(pos1, GetClientObject(pos2));
|
||||
wxClientData * const dataTmp = DetachClientObject(pos1);
|
||||
SetClientObject(pos1, DetachClientObject(pos2));
|
||||
SetClientObject(pos2, dataTmp);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user