SegFault using provided Set-methods to change variable values.
Posted: 08 Jul 2021, 23:22
Hello,
I have a severe issue that triggers a segmentation fault. The documentation is sparse on it.
So my issue is:
I have a variable type created and instantiated with UaModeler and compiled to C++ code.
Everything works so far. I can browse the namespace and see the variable.
However, when I try to change the value in code during runtime, it works exactly one time but crashes the second time with a segfault.
So... in my case: The ObjectTyp ObjT_1 has a FolderTyp SubT_1 and inside it the VariableType VarT_1.
Instantiated I have ObjA with FolderB and VariableC.
In my ObjektAType.cpp implementation (the one UaModeler marks as "not generated every time" - but it does anyway) I try to access the variable with the provided Set-Method.
In ObjAType.cpp there are also the Method skeletons that I have implemented and that I can call from the Client without a problem.
From the ObjAType.cpp can now call getFolderB().setVariableC("newValue"); to set a new value - once.
But when I call it a second time, I get a SegFault.
Why?? How to properly access these variables?
I have a severe issue that triggers a segmentation fault. The documentation is sparse on it.
So my issue is:
I have a variable type created and instantiated with UaModeler and compiled to C++ code.
Everything works so far. I can browse the namespace and see the variable.
However, when I try to change the value in code during runtime, it works exactly one time but crashes the second time with a segfault.
So... in my case: The ObjectTyp ObjT_1 has a FolderTyp SubT_1 and inside it the VariableType VarT_1.
Instantiated I have ObjA with FolderB and VariableC.
In my ObjektAType.cpp implementation (the one UaModeler marks as "not generated every time" - but it does anyway) I try to access the variable with the provided Set-Method.
In ObjAType.cpp there are also the Method skeletons that I have implemented and that I can call from the Client without a problem.
From the ObjAType.cpp can now call getFolderB().setVariableC("newValue"); to set a new value - once.
But when I call it a second time, I get a SegFault.
Why?? How to properly access these variables?