metadataengine/server/src/mdsmaintenanceengine.cpp
changeset 40 910a23996aa0
parent 31 81125601ee77
child 43 c5e73110f733
--- a/metadataengine/server/src/mdsmaintenanceengine.cpp	Wed Jul 14 07:57:22 2010 +0300
+++ b/metadataengine/server/src/mdsmaintenanceengine.cpp	Fri Jul 23 10:03:59 2010 +0300
@@ -79,6 +79,7 @@
 CMdSMaintenanceEngine::~CMdSMaintenanceEngine()
     {
     delete iMaintenance;
+    iMaintenance = NULL;
     }
 
 // ------------------------------------------------
@@ -117,7 +118,17 @@
 void CMdSMaintenanceEngine::InstallL( CMdSManipulationEngine& aManipulate, CMdsSchema& aSchema )
     {
     __LOG1( ELogAlways, "Trying to validate MDS DB, error expected if not created(first boot): %d", 0 );
-    if ( !(iMaintenance->ValidateL( ) ) )
+	
+    TBool isValid(EFalse);
+    TRAPD(err, isValid = iMaintenance->ValidateL( ));
+    
+    if(err == KErrCorrupt)
+        {
+        DeleteDatabase();
+        User::Leave( err );
+        }
+    
+    else if ( !isValid )
         {
         // Pump up priority to load the MDS DB up as fast as possible to
         // enable client side session connections