If a BitSet is used in that manner it is a bug, so having it crash is actually a good thing. Joris, On Tue, Jan 13, 2009 at 5:41 PM, Dominik Haumann wrote: > On Tuesday 06 January 2009, Andreas Hartmetz wrote: >> --- trunk/extragear/network/ktorrent/libbtcore/util/bitset.cpp >> #906635:906636 @@ -94,8 +94,7 @@ >> >> BitSet & BitSet::operator = (const BitSet & bs) >> { >> - if (data) >> - delete [] data; >> + delete [] data; >> num_bytes = bs.num_bytes; >> num_bits = bs.num_bits; >> data = new Uint8[num_bytes]; > > ...and while we are at it: operator= should check whether &bs == this. > Otherwise you delete data and then access invalid memory. ;) > > Dominik >