Skip to content

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

@datochan

Description

@datochan

操作系统: 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 实例. 可是问题出在哪里呢?
是我哪里使用的不对吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions