HP-Socket icon indicating copy to clipboard operation
HP-Socket copied to clipboard

调用 ITcpAgent->Stop 方法时程序Crash

Open datochan opened this issue 8 months ago • 1 comments

操作系统: Window 10 专业工作站版本, 22H2 编译环境: MSVC 17.10.5 amd64

程序大致流程是:

  1. HP_Create_TcpAgent 创建实例, 并调用 Start方法启动服务。
  2. 调用Connect()创建链接(注: 可能会创建多个链接)
  3. 任务完成后 依次调用 Disconnect() 断开所有链接。
  4. 调用 TcpAgent::Stop 方法停止服务。
  5. 调用 HP_Destroy_TcpAgent 释放实例。

可是每次在程序退出是程序都会崩溃,调试发现卡在第4步, 崩溃在 CTcpAgent 类的Stop中,如下图:

Image

我没有调用过 CTcpAgent 类实例化过任何对象。应该是 HP_Create_TcpAgent 返回的是 CTcpAgent 实例. 可是问题出在哪里呢? 是我哪里使用的不对吗?

datochan avatar Mar 25 '25 08:03 datochan

你用什么版本,请确保头文件与库版本绝对一致哦

ldcsaa avatar Apr 02 '25 17:04 ldcsaa