
Sun, 09/04/2011 - 17:13
Forums:
In TDF_Data.cxx myAllowModification is uninitialized parameter when we use malloc(or scalable_malloc) instead of calloc and after we have problem with detection of current state of transaction and Standard_ImmutableObject raise as result.
TDF_Data::TDF_Data() :
myTransaction (0),
myNbTouchedAtt (0),
myNotUndoMode (Standard_True),
myTime (0),
myAllowModification (Standard_True) //need this line
{
Sun, 09/04/2011 - 20:11
Hello, Yuriy, this line is there since at least OCCT 6.3.0, which version are you using?
Mon, 09/05/2011 - 01:36
It's wrong. After night assemblages has mixed.
TDocStd_Document::TDocStd_Document(const TCollection_ExtendedString& aStorageFormat) :
myStorageFormat(aStorageFormat),
myData (new TDF_Data()),
myUndoLimit(0),
mySaveTime(0),
myIsNestedTransactionMode(0),
myOnlyTransactionModification(0) //Add this line
{
Here is some blocks like
...
if(myOnlyTransactionModification) {
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit
? Standard_True :Standard_False);
}
...
And if myOnlyTransactionModification is not initialized we catch Standard_ImmutableObject with TDF_Label and TDF_Attribute.
I think a reason that when we use calloc, I really don't understand how, but myOnlyTransactionModification is set with 0 ( ? TDocStd_Document is a pointer data ?), but when malloc, we catch exceptions.
Wed, 09/07/2011 - 00:19
Weird, I do not understand why this is needed. Anyway, you should not set MMGT_CLEAR to 0 in order to avoid those errors.
Wed, 09/07/2011 - 23:02
I don't see any problem around use this option. Also I think that free method is more memory return with malloc, but it's only assumption, before I don't use calloc before and now I want to use malloc.
Thu, 09/08/2011 - 00:03
Sorry, I do not understand your answer. Obviously there is a problem, otherwise you would not post here ;-) And I am quite confident that this problem disappears if you do not set MMGT_CLEAR=0.
If you want to check all class members which are not explicitly initialized, be warned that this is a gigantic task. G++ reports that there are 143159 members not explicitly initialized. This is fine, those members are implicitly initialized and should not contain garbage.
Thu, 09/08/2011 - 01:48
I'm working on this at this moment )) And I don't find easy way ))