- on erasure the order of things in ts->order is reverse from that of
rpmtsi-iteration, causing rpmtsiNext() to abort earlier than it should
when things are removed underneath it
- just walk the ts->order table without iteration, it doesn't make any
difference here
void rpmtsEmpty(rpmts ts)
{
- rpmtsi pi; rpmte p;
- int oc;
-
if (ts == NULL)
return;
rpmtsClean(ts);
- for (pi = rpmtsiInit(ts), oc = 0; (p = rpmtsiNext(pi, 0)) != NULL; oc++) {
+ for (int oc = 0; oc < ts->orderCount; oc++) {
ts->order[oc] = rpmteFree(ts->order[oc]);
}
- pi = rpmtsiFree(pi);
ts->orderCount = 0;
ts->ntrees = 0;