|
@@ -101,16 +101,21 @@ void rblist__init(struct rblist *rblist)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+void rblist__exit(struct rblist *rblist)
|
|
|
+{
|
|
|
+ struct rb_node *pos, *next = rb_first(&rblist->entries);
|
|
|
+
|
|
|
+ while (next) {
|
|
|
+ pos = next;
|
|
|
+ next = rb_next(pos);
|
|
|
+ rblist__remove_node(rblist, pos);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void rblist__delete(struct rblist *rblist)
|
|
|
{
|
|
|
if (rblist != NULL) {
|
|
|
- struct rb_node *pos, *next = rb_first(&rblist->entries);
|
|
|
-
|
|
|
- while (next) {
|
|
|
- pos = next;
|
|
|
- next = rb_next(pos);
|
|
|
- rblist__remove_node(rblist, pos);
|
|
|
- }
|
|
|
+ rblist__exit(rblist);
|
|
|
free(rblist);
|
|
|
}
|
|
|
}
|