Trouble removing effect

2012-07-14
2013-04-29
  • Craig Brown
    Craig Brown
    2012-07-14

    I'm trying to remove an OperationGroup from an AAF file but leave the contents.  i.e. remove the effect…

    I'm getting the following assertion:

    The violation occurred at line 548 in file "../../src/OM/OMWeakRefPropertyT.h".
    The condition "container()->inFile()" was false.

    Looks like the removecomponent is putting the object in a state where I can't re-insert it.

    Any ideas greatly appreciated.

    I'm doing the following:

                hr = segment->QueryInterface(IID_IAAFComponent, reinterpret_cast<void**>(&component));
                if (hr != AAFRESULT_SUCCESS)
                    return ERR_set("Trouble removing grade.");

                hr = op_group->RemoveInputSegmentAt(i);
                if (hr != AAFRESULT_SUCCESS)
                    return ERR_set("Trouble removing grade.");
                hr = clip.eac_GradeSequence->InsertComponentAt(clip.eac_GradeSequenceIx, component);
                if (hr != AAFRESULT_SUCCESS)
                    return ERR_set("Trouble removing grade.");