下面是出现问题的提示:
Detected memory leaks!
Dumping objects ->
thrdcore.cpp(311) : {1550} client block at 0x01CFF300, subtype c0, 68 bytes long.
a CWinThread object at $01CFF300, 68 bytes long
thrdcore.cpp(311) : {1541} client block at 0x01CFEFB8, subtype c0, 68 bytes long.
a CWinThread object at $01CFEFB8, 68 bytes long
thrdcore.cpp(311) : {1532} client block at 0x01CFEC70, subtype c0, 68 bytes long.
Detected memory leaks!
Dumping objects ->
thrdcore.cpp(311) : {1550} client block at 0x01CFF300, subtype c0, 68 bytes long.
a CWinThread object at $01CFF300, 68 bytes long
thrdcore.cpp(311) : {1541} client block at 0x01CFEFB8, subtype c0, 68 bytes long.
a CWinThread object at $01CFEFB8, 68 bytes long
thrdcore.cpp(311) : {1532} client block at 0x01CFEC70, subtype c0, 68 bytes long.
具体怎么做呀!
在线程中
While(g_Run)
{
........
}可以在主线程中设置
g_Run = FALSE;
从而让线程退出
SOCKET最好是线程中的局部变量,因而线程退出时会释放资源