X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fmplexpholder.c;h=7a75486ef495ecc618857666f8cba84cacfd00e0;hb=20080411;hp=3cbf5fdc2fa46a87471482c2d71502780fcae14a;hpb=f869221ce49f0fb7cca48eee28daff8684305963;p=ion3.git diff --git a/ioncore/mplexpholder.c b/ioncore/mplexpholder.c index 3cbf5fd..7a75486 100644 --- a/ioncore/mplexpholder.c +++ b/ioncore/mplexpholder.c @@ -1,7 +1,7 @@ /* * ion/ioncore/mplexpholder.c * - * Copyright (c) Tuomo Valkonen 2005-2007. + * Copyright (c) Tuomo Valkonen 2005-2008. * * See the included file LICENSE for details. */ @@ -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;