Re: iterate over a model and remove rows



Le dimanche 07 octobre 2007 à 00:21 +0200, Renà Stadler a Ãcrit :
Am Freitag, den 05.10.2007, 19:48 +0200 schrieb BenoÃt Dejean:
Hello,

I'd like to know if it is safe to walk over a model and remove rows at
the same time. I'm doing this in gnome-system-monitor in many places.

Two examples:

The first function walks a list_store and removes some rows.
But i can see that multiple passes are required to drop all the old
rows, i.e. it is necessary to walk the list again to find new elements.
For example, if the list's size is ~100, a dozen of walks are required.

Actually I'd expect a half-dozen of runs, see below.

Uhuh thank you. I was so focused on the segfault, i didn't see easy
error :)

-- 
BenoÃt Dejean
GNOME http://www.gnomefr.org/
LibGTop http://directory.fsf.org/libgtop.html


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