Hi Fix8 Support,
I am attempting to use stack memory for my messages and fields however FIX8::MessageBase's destructor calls clear(false) which uses the 'delete' operator on all entries in the _fields map. This results in a seg fault since the fields are not heap allocated.
I don't see any way to remove fields from the map, or clear the map without the use of 'delete'.
Here is some pseudo code that illustrates the issue:
struct MyMessageWithFields
{
// Actual FIX8 message
FIX8::MyFix::MyMessage msg{};
// Fields
FIX8::MyFix::Field1 field1{};
FIX8::MyFix::Field2 field2{};
MyMessageWithFields() {
msg.add_field(&field1);
msg.add_field(&field2);
}
~MyMessageWithFields() {
// Would be nice to remove fields here
}
};
int main(int argc, char *argv[])
{
{
MyMessageWithFields myMessage{};
} // seg fault here
return 0;
}
Please advise on how to use stack memory for fields without running into this seg fault.
Thanks,
Andrew Michell