Show
Ignore:
Timestamp:
11/05/10 15:16:05 (2 years ago)
Author:
westram
Message:
  • stuffed all direct memory leaks in GB_open/GB_close
    • call gbcm_logout for main-user
    • free dates
    • gb_delete_main_entry -> gb_delete_dummy_father
    • free key data
    • free command hash
    • splitted up gb_delete_entry into GBDATA- and GBCONTAINER-version
    • destroy DB indices when destroying GBCONTAINER
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ARBDB/adindex.cxx

    r6640 r6648  
    173173    } 
    174174    return error; 
     175} 
     176 
     177void gb_destroy_indices(GBCONTAINER *gbc) { 
     178    gb_index_files_struct *ifs = GBCONTAINER_IFS(gbc); 
     179 
     180    while (ifs) { 
     181        GB_REL_IFES *if_entries = GB_INDEX_FILES_ENTRIES(ifs); 
     182 
     183        for (int index = 0; index<ifs->hash_table_size; index++) { 
     184            gb_if_entries *ifes = GB_ENTRIES_ENTRY(if_entries, index); 
     185 
     186            while (ifes) { 
     187                gb_if_entries *ifes_next = GB_IF_ENTRIES_NEXT(ifes); 
     188 
     189                gbm_free_mem((char*)ifes, sizeof(*ifes), GB_GBM_INDEX(gbc)); 
     190                ifes = ifes_next; 
     191            } 
     192        } 
     193        free(if_entries); 
     194 
     195        gb_index_files_struct *ifs_next = GB_INDEX_FILES_NEXT(ifs); 
     196        free(ifs); 
     197        ifs = ifs_next; 
     198    } 
    175199} 
    176200