Changeset b014e9f in mainline for kernel/generic/src/adt/hash_table.c


Ignore:
Timestamp:
2009-04-06T15:44:50Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
415d272
Parents:
37be841
Message:

call remove_callback only optionally
(this fixes the cleanup phase of the reboot command)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/adt/hash_table.c

    r37be841 rb014e9f  
    132132/** Remove all matching items from hash table.
    133133 *
    134  * For each removed item, h->remove_callback() is called.
     134 * For each removed item, h->remove_callback() is called (if not NULL).
    135135 *
    136136 * @param h Hash table.
     
    147147        ASSERT(h->op->hash);
    148148        ASSERT(h->op->compare);
    149         ASSERT(h->op->remove_callback);
    150149        ASSERT(keys <= h->max_keys);
    151150       
     
    159158                if (cur) {
    160159                        list_remove(cur);
    161                         h->op->remove_callback(cur);
     160                        if (h->op->remove_callback)
     161                                h->op->remove_callback(cur);
    162162                }
    163163                return;
     
    177177                               
    178178                                list_remove(hlp);
    179                                 h->op->remove_callback(hlp);
     179                                if (h->op->remove_callback)
     180                                        h->op->remove_callback(hlp);
    180181                               
    181182                                continue;
Note: See TracChangeset for help on using the changeset viewer.