PtrList of surfaceScalarFields -> destructor problem?
Hello everybody,
I have a class that contains several surfaceScalarFields which I want to loop over. Therefore I set up a PtrList in the constructor: Code:
Code:
End of run. Code:
myClass::~myClass() |
Some of your fields (FieldA_, etc) might've gone out of scope and destroyed themselves, in which case, you'd have an invalid pointer that PtrList is trying to free.
Your description lacks context - it's hard to judge where the problem is, because it's definitely not in the lines that you describe. |
Thank you,
I have not found it yet, but I keep on searching.... |
It does look like your surfaceScalarFields are going out of scope somewhere.
Important: If you are looking to reference fields from a PtrList, you need to be careful since PtrList automatically destructs the objects you assign to it with the ::set member function. Rather use UPtrList in your case since it will not destruct your fields when it goes out of scope. |
All times are GMT -4. The time now is 02:42. |