Re: Cross-coupling comboboxes

On 07/06/2019 19:56, Daniel Boles via gtkmm-list wrote:
It's not particularly clear what's going on. Posting the minimal code required to reproduce this on a pastebin and linking it would be great.

Yes, I know, but this is all well embedded into a large code base, so it won't be easy. I'll try building up from my initial hack of the ComboBox example to see if, and with which additions, I can reproduce the problem.

Are you taking an iterator into the model, then clearing the model, then trying to use the former iterator again? That definitely won't end well, I don't think.

No. At least, not knowingly. The only place I'm using an iterator is for the "signal_changed" handler of one combobox to pass it directly to the other combobox. (well, there are other places where I use one to iterate or to populate a newly added entry, but those aren't involved in this bit). What appears to happen, which I wasn't expecting, is the m_refTreeModel->clear(); call invokes the combobox signal_changed handler for every row? And when it does so, the iterator returned by get_active() is invalid, which my code doesn't test for in the secondary case, so that would be worth doing... hold on...

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]