Use child's listmodelnotifier's destructor (by overloading
it) to get informed about the destruction of the child model in a sorted model. Removed Freed() method used for that so far. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -38,13 +38,6 @@ wxDataViewListModel::wxDataViewListModel()
|
||||
|
||||
wxDataViewListModel::~wxDataViewListModel()
|
||||
{
|
||||
wxList::compatibility_iterator node = m_notifiers.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData();
|
||||
notifier->Freed();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
bool wxDataViewListModel::RowAppended()
|
||||
@@ -217,6 +210,9 @@ class wxDataViewSortedListModelNotifier: public wxDataViewListModelNotifier
|
||||
public:
|
||||
wxDataViewSortedListModelNotifier( wxDataViewSortedListModel *model )
|
||||
{ m_model = model; }
|
||||
|
||||
~wxDataViewSortedListModelNotifier()
|
||||
{ m_model->DetachChild(); }
|
||||
|
||||
virtual bool RowAppended()
|
||||
{ return m_model->ChildRowAppended(); }
|
||||
@@ -242,9 +238,6 @@ public:
|
||||
virtual bool Cleared()
|
||||
{ return m_model->ChildCleared(); }
|
||||
|
||||
virtual bool Freed()
|
||||
{ m_model->m_child = NULL; return wxDataViewListModelNotifier::Freed(); }
|
||||
|
||||
wxDataViewSortedListModel *m_model;
|
||||
};
|
||||
|
||||
@@ -325,7 +318,12 @@ wxDataViewSortedListModel::wxDataViewSortedListModel( wxDataViewListModel *child
|
||||
wxDataViewSortedListModel::~wxDataViewSortedListModel()
|
||||
{
|
||||
if (m_child)
|
||||
m_child->RemoveNotifier( m_notifierOnChild );
|
||||
m_child->RemoveNotifier( m_notifierOnChild );
|
||||
}
|
||||
|
||||
void wxDataViewSortedListModel::DetachChild()
|
||||
{
|
||||
m_child = NULL;
|
||||
}
|
||||
|
||||
// FIXME
|
||||
|
||||
Reference in New Issue
Block a user