Changeset 9252


Ignore:
Timestamp:
Oct 9, 2009, 8:06:22 PM (12 years ago)
Author:
charles
Message:

(trunk libT) add a couple more debugging assertions into the nightlies to try & smoke out the handshake/peer-io crashes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bandwidth.c

    r8483 r9252  
    120120    assert( b != parent );
    121121
     122//fprintf( stderr, "setting parent for %p: %p\n", b, parent );
    122123    if( b->parent )
    123124    {
     125        void * removed;
     126
    124127        assert( tr_isBandwidth( b->parent ) );
    125128
    126         tr_ptrArrayRemoveSorted( &b->parent->children, b, comparePointers );
     129        removed = tr_ptrArrayRemoveSorted( &b->parent->children, b, comparePointers );
     130        assert( removed == b );
     131        assert( tr_ptrArrayFindSorted( &b->parent->children, b, comparePointers ) == NULL );
     132//fprintf( stderr, "removed child bandwidth %p from old parent %p\n", b, b->parent );
     133
    127134        b->parent = NULL;
    128135    }
     
    134141
    135142        tr_ptrArrayInsertSorted( &parent->children, b, comparePointers );
     143        assert( tr_ptrArrayFindSorted( &parent->children, b, comparePointers ) == b );
     144//fprintf( stderr, "set new parent for %p: %p\n", b, parent );
    136145        b->parent = parent;
    137146    }
Note: See TracChangeset for help on using the changeset viewer.