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

List:       kde-commits
Subject:    Re: koffice/kexi/kexidb
From:       Jarosław_Staniek <js () iidea ! pl>
Date:       2007-07-19 8:32:17
Message-ID: 469F2191.4000707 () iidea ! pl
[Download RAW message or body]

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.

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice: http://www.kexi.pl/en, http://www.koffice.org
  KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org
[prev in list] [next in list] [prev in thread] [next in thread] 

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