From edc973b1749e09a437f8043e9833383b0f2457cb Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Tue, 27 Aug 2002 20:28:48 +0000 Subject: [PATCH] wxItemContainer already deletes client data; don't delete (again) the data in the control. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/choice.cpp | 3 +-- src/gtk/listbox.cpp | 3 +-- src/gtk1/choice.cpp | 3 +-- src/gtk1/listbox.cpp | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index ef17528812..c9e3cceac2 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -166,8 +166,7 @@ void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData ) wxNode *node = m_clientList.Nth( n ); wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientObject") ); - wxClientData *cd = (wxClientData*) node->Data(); - delete cd; + // wxItemContainer already deletes data for us node->SetData( (wxObject*) clientData ); } diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index b81275e629..c84fce5452 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -642,8 +642,7 @@ void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData ) wxNode *node = m_clientList.Nth( n ); wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientObject") ); - wxClientData *cd = (wxClientData*) node->Data(); - delete cd; + // wxItemContainer already deletes data for us node->SetData( (wxObject*) clientData ); } diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index ef17528812..c9e3cceac2 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -166,8 +166,7 @@ void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData ) wxNode *node = m_clientList.Nth( n ); wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientObject") ); - wxClientData *cd = (wxClientData*) node->Data(); - delete cd; + // wxItemContainer already deletes data for us node->SetData( (wxObject*) clientData ); } diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index b81275e629..c84fce5452 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -642,8 +642,7 @@ void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData ) wxNode *node = m_clientList.Nth( n ); wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientObject") ); - wxClientData *cd = (wxClientData*) node->Data(); - delete cd; + // wxItemContainer already deletes data for us node->SetData( (wxObject*) clientData ); } -- 2.45.2