自定义ComboxBox串口扫描析构时出错

自定义ComboxBox串口扫描析构时出错

首先是源码:

网上源码基本都一样可以参考:
https://blog.csdn.net/Mark_md/article/details/109048127

其次是问题:

在debug模式下启动可正常运行,
在release模式下扫描串口析构时出错。

以下为调用堆栈:

 	ntdll.dll!_RtlReportCriticalFailure@12()	未知
 	ntdll.dll!_RtlpReportHeapFailure@4()	未知
 	ntdll.dll!_RtlpHpHeapHandleError@12()	未知
 	ntdll.dll!_RtlpLogHeapFailure@24()	未知
 	ntdll.dll!_RtlpFreeHeapInternal@20()	未知
 	ntdll.dll!RtlFreeHeap()	未知
 	ucrtbase.dll!_free_base()	未知
 	ucrtbase.dll!_free()	未知
>	HallMotorTest.exe!operator delete(void * block, unsigned int __formal) 行 31	C++
 	HallMotorTest.exe!QList<QSerialPortInfo>::~QList<QSerialPortInfo>() 行 874	C++
 	HallMotorTest.exe!myComboBox::scanActivePort() 行 35	C++
 	HallMotorTest.exe!myComboBox::myComboBox(QWidget * parent) 行 10	C++

原因:

在VS + QT环境下添加 附加依赖项 时 全部配置成了 Qt5SerialPortd.lib;%(AdditionalDependencies)

Qt5SerialPortd.lib 是debug环境下使用的动态链接库
Qt5SerialPort.lib 是release环境下使用的动态链接库

改正:

附加依赖项 改为添加对应动态链接库

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值