[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Strange QPtrList behaviour
From: Waldo Bastian <bastian () kde ! org>
Date: 2003-02-05 21:11:25
[Download RAW message or body]
On Wednesday 05 February 2003 21:57, Christian Hubinger wrote:
> On Wednesday 05 February 2003 21:02, Joachim Weber wrote:
> [snip]
>
> > Did you try the following?
> >
> > IPTRule* new_rule;
> > for ( new_rule = have_list.first(); new_rule != 0; new_rule =
> > have_list.next() ) { ... do something
> > }
>
> yes, also ended up in an endles loop ;(
This typically happens if the "... do something" part also accesses
"have_list". A QPtrListIterator can help in such case:
QPtrListIterator<IPTRule> it(have_list);
IPTRule* new_rule;
for(; new_rule = it.current(); ++it)
{
... do something
}
Cheers,
Waldo
--
bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic