pseudomap: dont crash on destroy if map is null
the previous contract for orderedlist was that orderedmap_destroy() can be called with a NULL pointer.
This commit is contained in:
parent
2508c1a5e6
commit
78e4a6d902
@ -28,6 +28,7 @@ pseudomap *pseudomap_create(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void pseudomap_destroy(pseudomap *o) {
|
void pseudomap_destroy(pseudomap *o) {
|
||||||
|
if(!o) return;
|
||||||
while(sblist_getsize(o)) {
|
while(sblist_getsize(o)) {
|
||||||
/* retrieve latest element, and "shrink" list in place,
|
/* retrieve latest element, and "shrink" list in place,
|
||||||
so we don't have to constantly rearrange list items
|
so we don't have to constantly rearrange list items
|
||||||
|
Loading…
Reference in New Issue
Block a user