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

List:       kde-commits
Subject:    kdesdk/kbabel/common
From:       Laurent Montel <montel () kde ! org>
Date:       2003-12-03 14:22:17
[Download RAW message or body]

CVS commit by mlaurent: 

Fix mem leak.
if( bla) delete bla; => delete bla;


  M +194 -184  catalog.cpp   1.122
  M +9 -9      catalogitem.cpp   1.59
  M +4 -6      kbmailer.cpp   1.9


--- kdesdk/kbabel/common/catalog.cpp  #1.121:1.122
@@ -70,7 +70,17 @@ Catalog::Catalog(QObject* parent, const 
    d->_configFile=configFile;
    KConfig *config;
-   if(d->_configFile.isEmpty() ) config = KGlobal::config();
-   else config=new KConfig(d->_configFile);
+   bool bConfigMustBeDeleted = false;
+   if(d->_configFile.isEmpty() )
+   {
+       config = KGlobal::config();
+   }
+   else
+   {
+       config=new KConfig(d->_configFile);
+       bConfigMustBeDeleted = true;
+   }
    readPreferences(config);
+   if (  bConfigMustBeDeleted )
+       delete config;
 }
 

--- kdesdk/kbabel/common/catalogitem.cpp  #1.58:1.59
@@ -52,5 +52,5 @@ CatalogItem::CatalogItem(const CatalogIt
 CatalogItem::~CatalogItem()
 {
-    if( d ) delete d;
+    delete d;
 }
 

--- kdesdk/kbabel/common/kbmailer.cpp  #1.8:1.9
@@ -59,7 +59,5 @@ KBabelMailer::~KBabelMailer()
   saveConfig( );
 
-  if ( editCompletion )  
     delete editCompletion;
-  if ( editDialog )
     delete editDialog;
   


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

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