[Valentina] M:M problems

Eric Forget forgete at cafederic.com
Mon Jan 20 13:11:50 CST 2003


>> Finally, if I create an FBL_AraySet from a FBL_BitSet like this:
>> 
>> mGroupArray = mReceipe.Sort(allSet, mGroup.mName, true);
>> 
>> It looks like I have to keep alive allSet until mGroupArray is not deleted.
>> Otherwise, mGroupArray becomes corrupted, isn't it?
> 
> Of course no.
> 
> We need to economy memory :-)

So why if I have this code:

void
CDatabase::UpdateGroupArray()
{
    FBL_BitSet    *allSet;
    
    delete mGroupArray;
    allSet = mGroup.SelectAllRecords();
    mGroupArray = mGroup.Sort(allSet, mGroup.mName, true);
    
    delete allSet;
    
    if (mGroupArray != NULL) {
    
        mGroupArray->GetCount();
    }
}

I always crash on mGroupArray->GetCount(); ?

If I comment out delete allSet; it doesn't crash!

Éric
___________________________________________________________________

 Eric Forget                       Cafederic
 ForgetE at cafederic.com             <http://www.cafederic.com/>

 Fingerprint <86D5 38F5 E1FD 5D9C 71C3  BAA3 797E 70A4 6210 C684>




More information about the Valentina mailing list