Avoid using already-destroyed parts of wxChoice/wxComboBox during destruction
When used as a wxDVC cell editor, GtkComboBox has already destroyed it's model and child GtkEntry by the time our dtor is called. See #17034
This commit is contained in:
@@ -99,7 +99,10 @@ wxEND_EVENT_TABLE()
|
||||
wxComboBox::~wxComboBox()
|
||||
{
|
||||
if (m_entry)
|
||||
{
|
||||
GTKDisconnect(m_entry);
|
||||
g_object_remove_weak_pointer(G_OBJECT(m_entry), (void**)&m_entry);
|
||||
}
|
||||
}
|
||||
|
||||
void wxComboBox::Init()
|
||||
@@ -213,6 +216,7 @@ void wxComboBox::GTKCreateComboBoxWidget()
|
||||
g_object_ref(m_widget);
|
||||
|
||||
m_entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(m_widget)));
|
||||
g_object_add_weak_pointer(G_OBJECT(m_entry), (void**)&m_entry);
|
||||
}
|
||||
|
||||
GtkEditable *wxComboBox::GetEditable() const
|
||||
|
Reference in New Issue
Block a user