Ignore:
Timestamp:
02/19/15 14:24:03 (5 years ago)
Author:
jls17
Message:
  • fixed some memory leaks in case memory allocation fails in ARFieldList.cpp and ARSchemaList.cpp
  • small changes to the initialization of the crash handler
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/work_320/lists/ARSchemaList.cpp

    r675 r679  
    374374        for (unsigned int schemaIndex = 0; schemaIndex < count; ++schemaIndex) 
    375375        { 
    376                 CARFieldListServer *srvFieldList = new CARFieldListServer(schemaIndex); 
    377                 srvFieldList->LoadFromServer(); // TODO: maybe check if successfully loaded 
    378                 srvFieldList->Sort(); 
     376                CARFieldListServer *srvFieldList = NULL; 
     377                try 
     378                { 
     379                        srvFieldList = new CARFieldListServer(schemaIndex); 
     380                        srvFieldList->LoadFromServer(); // TODO: maybe check if successfully loaded 
     381                        srvFieldList->Sort(); 
     382                } 
     383                catch (exception &e) 
     384                { 
     385                        cerr << "FATAL: loading fields for '" << SchemaGetName(schemaIndex) << "' failed with: " << e.what() << endl; 
     386                        if (srvFieldList != NULL) { delete srvFieldList; } 
     387                        srvFieldList = new CARFieldListServer(schemaIndex); 
     388                } 
    379389                fieldLists.push_back(srvFieldList); 
    380390        } 
Note: See TracChangeset for help on using the changeset viewer.