]> git.saurik.com Git - wxWidgets.git/commitdiff
Handle client data correctly.
authorMattia Barbon <mbarbon@cpan.org>
Sat, 17 Jan 2004 22:14:38 +0000 (22:14 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Sat, 17 Jan 2004 22:14:38 +0000 (22:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/combobox.cpp
src/gtk1/combobox.cpp
src/mac/carbon/combobox.cpp
src/mac/combobox.cpp

index f295daac11ac6cbabc4a3f649beb6808a66030e2..6e268ed40d90f6cc7d76211336550c5bd9a40efe 100644 (file)
@@ -327,8 +327,7 @@ void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData )
     wxList::compatibility_iterator node = m_clientObjectList.Item( n );
     if (!node) return;
 
     wxList::compatibility_iterator node = m_clientObjectList.Item( n );
     if (!node) return;
 
-    wxClientData *cd = (wxClientData*) node->GetData();
-    if (cd) delete cd;
+    // wxItemContainer already deletes data for us
 
     node->SetData( (wxObject*) clientData );
 }
 
     node->SetData( (wxObject*) clientData );
 }
index f295daac11ac6cbabc4a3f649beb6808a66030e2..6e268ed40d90f6cc7d76211336550c5bd9a40efe 100644 (file)
@@ -327,8 +327,7 @@ void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData )
     wxList::compatibility_iterator node = m_clientObjectList.Item( n );
     if (!node) return;
 
     wxList::compatibility_iterator node = m_clientObjectList.Item( n );
     if (!node) return;
 
-    wxClientData *cd = (wxClientData*) node->GetData();
-    if (cd) delete cd;
+    // wxItemContainer already deletes data for us
 
     node->SetData( (wxObject*) clientData );
 }
 
     node->SetData( (wxObject*) clientData );
 }
index c3c5660bbf5163b8502539f6e28406182488d670..5a911361cf45633608dd12505d3a67c6c3ec64ed 100644 (file)
@@ -162,7 +162,10 @@ END_EVENT_TABLE()
 
 wxComboBox::~wxComboBox()
 {
 
 wxComboBox::~wxComboBox()
 {
-   // delete the controls now, don't leave them alive even though they would
+    // delete client objects
+    FreeData();
+
+    // delete the controls now, don't leave them alive even though they would
     // still be eventually deleted by our parent - but it will be too late, the
     // user code expects them to be gone now
     if (m_text != NULL) {
     // still be eventually deleted by our parent - but it will be too late, the
     // user code expects them to be gone now
     if (m_text != NULL) {
index c3c5660bbf5163b8502539f6e28406182488d670..5a911361cf45633608dd12505d3a67c6c3ec64ed 100644 (file)
@@ -162,7 +162,10 @@ END_EVENT_TABLE()
 
 wxComboBox::~wxComboBox()
 {
 
 wxComboBox::~wxComboBox()
 {
-   // delete the controls now, don't leave them alive even though they would
+    // delete client objects
+    FreeData();
+
+    // delete the controls now, don't leave them alive even though they would
     // still be eventually deleted by our parent - but it will be too late, the
     // user code expects them to be gone now
     if (m_text != NULL) {
     // still be eventually deleted by our parent - but it will be too late, the
     // user code expects them to be gone now
     if (m_text != NULL) {