X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fgrouppholder.c;h=cdd2dce546b35b144132d83adc1340f63750e7ba;hp=39ff6fc519b34372d61f1a98c52842607a826818;hb=20080411;hpb=5e1e6e6c4467839ec70cee64dc1faabcf08e2a5f diff --git a/ioncore/grouppholder.c b/ioncore/grouppholder.c index 39ff6fc..cdd2dce 100644 --- a/ioncore/grouppholder.c +++ b/ioncore/grouppholder.c @@ -72,17 +72,21 @@ void grouppholder_do_unlink(WGroupPHolder *ph) if(group!=NULL){ UNLINK_ITEM(group->phs, ph, next, prev); - }else{ + }else if(ph->prev!=NULL){ WGroupPHolder *next=ph->next; - if(ph->prev!=NULL) - ph->prev->next=next; + ph->prev->next=next; if(next==NULL){ next=get_head(ph); assert(next->prev==ph); } next->prev=ph->prev; + }else{ + /* ph should not be on a list, if prev pointer is NULL (whereas + * next alone can be NULL in our semi-doubly-linked lists). + */ + assert(ph->next==NULL); } ph->group=NULL;