Page 2 of 2

Re: [C++] Clear resources on collection item remove.

Posted: 28 Mar 2018, 15:05
by realesmedia
Wait for another sample. We've got cool stuff to show.

Re: [C++] Clear resources on collection item remove.

Posted: 28 Mar 2018, 15:32
by realesmedia
One more sample.
Modified version. Changes:
* Added UserControl with data binding;
* Button Click event process all items manually:
while (m_first_ctx->Count()) {
	m_first_ctx->RemoveAt(0);
}
m_first_ctx->Clear(); //< have no effect
Normal case:
Run app, select item and click clear button: all destructors calls.

Bug case:
Run app, select item, select second tab, click clear button: destructor for selected item didn't call. And it is in case when we manually remove item.

If I use TextBlock instead of UserControl, bug cannot be reproduced.