X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fmplexpholder.c;h=7a75486ef495ecc618857666f8cba84cacfd00e0;hb=831140ef97f8ad74f97b65346da5c3b70924311b;hp=712cfba7304fc0e6cd5a28bd5b7f8d858841e566;hpb=df57861c962a50bfbf57f276d288395fe0c6a4b6;p=ion3.git diff --git a/ioncore/mplexpholder.c b/ioncore/mplexpholder.c index 712cfba..7a75486 100644 --- a/ioncore/mplexpholder.c +++ b/ioncore/mplexpholder.c @@ -84,17 +84,21 @@ void mplexpholder_do_unlink(WMPlexPHolder *ph, WMPlex *mplex) UNLINK_ITEM(ph->after->phs, ph, next, prev); }else if(mplex!=NULL && on_ph_list(mplex->misc_phs, ph)){ UNLINK_ITEM(mplex->misc_phs, ph, next, prev); - }else{ + }else if(ph->prev!=NULL){ WMPlexPHolder *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->after=NULL;