T_dynData: do not dynamically create struct

This commit is contained in:
Siegfried Siegert 2024-05-16 15:18:30 +02:00
parent ea7542a248
commit b946dc5a92
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -702,7 +702,8 @@ void ATBDeviceControllerPlugin::onPrinterWaitForPrintingReceipt()
void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant> & printingData)
{
struct T_dynDat *dynTicketData = new T_dynDat;
struct T_dynDat dynamicTicketData;
struct T_dynDat *dynTicketData = &dynamicTicketData;
memset(dynTicketData, 0, sizeof(*dynTicketData));
qCritical() << "ATBDeviceControllerPlugin::requestPrintTicket( " << endl
@ -946,7 +947,8 @@ void ATBDeviceControllerPlugin::onPrinterPrepareDynTemplateData()
}
void ATBDeviceControllerPlugin::prepareDynTemplateData()
{
struct T_dynDat *dynTicketData = new T_dynDat;
struct T_dynDat dynamicTicketData;
struct T_dynDat *dynTicketData = &dynamicTicketData;
memset(dynTicketData, 0, sizeof(*dynTicketData));
// setup dynTicketData dependent on currentTicket