[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: koffice/kexi/kexidb
From:       Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date:       2007-07-19 8:36:45
Message-ID: 200707191036.48280.stefan.nikolaus () kdemail ! net
[Download RAW message or body]


On Thursday 19 July 2007 10:32:17 Jarosław Staniek wrote:
> Stefan Nikolaus said the following, On 2007-07-19 10:26:
> > On Thursday 19 July 2007 10:13:25 Jaroslaw Staniek wrote:
> >> SVN commit 689813 by staniek:
> >>
> >> KexiDB
> >> = removed possible crash on application quit
> >>
> >>
> >>
> >>  M  +3 -1      driver.cpp
> >>
> >>
> >> --- trunk/koffice/kexi/kexidb/driver.cpp #689812:689813
> >> @@ -89,7 +89,9 @@
> >>  {
> >>  	DriverManagerInternal::self()->aboutDelete( this );
> >>  //	KexiDBDbg << "Driver::~Driver()" << endl;
> >> -	qDeleteAll( d->connections );
> >> +	// make a copy because d->connections will be touched by ~Connection
> >> +	QSet<Connection*> connections(d->connections);
> >> +	qDeleteAll( connections );
> >>  	d->connections.clear();
> >>  	delete beh;
> >>  	delete d;
> >
> > There's no difference. qDeleteAll() deletes all Connection objects, but
> > leaves the QSet untouched, i.e. the pointers stay and point to the memory
> > locations, where the Connection objects were stored before. So, the copy
> > of the QSet does not make much sense; clearing the QSet (d->connections)
> > may do.
>
> But Connection::destroy(), which is called from Connection implementations,
> removes the connection pointer from the set.

Ah, and qDeleteAll()'s iteration gets out of sync. Okay, sorry for the noise.

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic