itas109 / CSerialPort

CSerialPort - lightweight cross-platform serial port library for C++/C/C#/Java/Python/Node.js/Electron
https://blog.csdn.net/itas109/article/details/84282860
Other
730 stars 339 forks source link

Detected memory leaks! - from signal3::connct #59

Closed busyyang closed 6 months ago

busyyang commented 2 years ago

描述bug 使用CSerialPort_win_3.0.3/Demo/Comm,在关闭窗口退出的时候出现Detected memory leaks!的问题:

Detected memory leaks!
Dumping objects ->
{497} normal block at 0x00FD6270, 16 bytes long.
 Data: <x       &       > 78 A7 D7 00 C8 FA CF 00 26 C6 D3 00 00 00 00 00 
Object dump complete.
程序“[17556] Comm.exe”已退出,返回值为 2 (0x2)。

通过Debug定位到sigslot.h中的signal3::connect中_connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>* conn = new _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>(pclass, pmemfun);未释放内存。

重现步骤 打开Demo调试运行,关闭后可在输出窗口中发现内存泄漏信息。

运行环境信息:

itas109 commented 2 years ago

感谢反馈 如果着急建议使用4.X版本

itas109 commented 6 months ago

sigslot not support on v4.3.x