Show
Ignore:
Timestamp:
01/24/08 15:11:54 (1 year ago)
Author:
cneumann
Message:

fixed: aspect sync for child/parent fields

missing editSField/editMField calls

added: simple test program for MT

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/FieldContainer/Fields/OSGMChildFCPointerField.inl

    r1032 r1041  
    996996    UInt32   uiSyncInfo, AspectOffsetStore  &oOffsets  ) 
    997997{ 
    998     if(source.size() > 0) 
     998    UInt32 oldSize = this  ->size(); 
     999    UInt32 newSize = source. size(); 
     1000 
     1001    if(newSize > 0) 
    9991002    { 
    1000         resize(source.size()); 
     1003        if(newSize < oldSize) 
     1004        { 
     1005            StorageIter oI = this->editRawStorage().begin() + newSize; 
     1006            StorageIter oE = this->editRawStorage().end  (); 
     1007             
     1008            for(; oI != oE; ++oI) 
     1009            { 
     1010                decRefCount(*oI); 
     1011            } 
     1012        } 
    10011013         
     1014        this->editRawStorage().resize(newSize); 
     1015             
    10021016        StorageConstIter sI = source.getRawStorage ().begin(); 
    1003         StorageConstIter sE = source.getRawStorage ().begin(); 
     1017        StorageConstIter sE = source.getRawStorage ().end  (); 
    10041018         
    10051019        StorageIter      tI = this ->editRawStorage().begin(); 
     
    10071021        for(; sI != sE; ++sI, ++tI) 
    10081022        { 
    1009             *tI = convertToCurrentAspect(*sI); 
    1010             incRefCount(*tI); 
    1011             linkParent (*tI); 
     1023            ValueType newVal = convertToCurrentAspect(*sI); 
     1024         
     1025            incRefCount(newVal); 
     1026            decRefCount(*tI   ); 
     1027             
     1028            *tI = newVal; 
     1029             
     1030            FINFO(("MChildFCPointerField<>::syncWith: sI [%p] tI [%p]\n", 
     1031                *sI, *tI)); 
    10121032        } 
    10131033    }