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

List:       kde-commits
Subject:    branches/work/kdepim-3.5.5+/kpilot/lib
From:       Bertjan Broeksema <b.broeksema () home ! nl>
Date:       2007-02-14 21:54:08
Message-ID: 1171490048.643565.17503.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 633702 by bbroeksema:

Make the idmapper leak 0 bytes.


 M  +0 -6      branches/work/kdepim-3.5.5+/kpilot/lib/idmapper.cc  
 M  +4 -9      branches/work/kdepim-3.5.5+/kpilot/lib/idmapperxml.cc  


--- branches/work/kdepim-3.5.5+/kpilot/lib/idmapper.cc #633701:633702
@@ -101,9 +101,6 @@
 	
 	fP->fXmlSource->addMapping( mapping );
 	fP->fXmlSource->save();
-	
-	delete mapping;
-	mapping = 0l;
 }
 
 void IDMapper::registerHHObjectId( const QString &conduit, recordid_t pid )
@@ -115,9 +112,6 @@
 	
 	fP->fXmlSource->addMapping( mapping );
 	fP->fXmlSource->save();
-	
-	delete mapping;
-	mapping = 0l;
 }
 
 QValueList<QString> IDMapper::getPCObjectIds( const QString &conduit )
--- branches/work/kdepim-3.5.5+/kpilot/lib/idmapperxml.cc #633701:633702
@@ -29,18 +29,12 @@
 
 IDMapperXml::IDMapperXml( const QString &file ) : fFile(file), fCurrentMapping(0l)
 {
+	fMappings.setAutoDelete( true );
 }
 
 IDMapperXml::~IDMapperXml()
 {
 	FUNCTIONSETUP;
-	//fMappings.setAutoDelete( true );
-	
-	if( fCurrentMapping )
-	{
-		delete fCurrentMapping;
-		fCurrentMapping = 0l;
-	}
 }
 
 bool IDMapperXml::open()
@@ -93,8 +87,6 @@
 		<< " mappings..." << endl;
 	DEBUGKPILOT << fname << ": ";
 	
-	//QPtrList<IDMapping *>::const_iterator it = fMappings.begin();
-	
 	IDMapping *mapping;
 	for ( mapping = fMappings.first(); mapping; mapping = fMappings.next() )
 	{
@@ -193,6 +185,8 @@
 bool IDMapperXml::endElement( const QString &namespaceURI
 	, const QString &localName, const QString &qName )
 {
+	FUNCTIONSETUP;
+
 	Q_UNUSED(namespaceURI);
 	Q_UNUSED(localName);
 	Q_UNUSED(qName);
@@ -201,6 +195,7 @@
 	if( qName == "mapping" && fCurrentMapping )
 	{
 		fMappings.append( fCurrentMapping );
+		fCurrentMapping = 0l;
 	}
 	
 	return true;
[prev in list] [next in list] [prev in thread] [next in thread] 

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