Есть Socket сервер , все отлично работает,написал называется, начал тестировать на утечки и тут собс-но они обнаружились
Ниже написал очень упрощенный вариант ,скажите что тут не так?может сокеты не так удаляю?
//===========в stdafx.h это
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <winsock.h>
#include <stdio.h>
#include <fstream>
//======================
#include "stdafx.h"
#pragma comment (lib, "ws2_32.lib")
using namespace std;
int main(int argc, char* argv[])
{
WSADATA wsa;
SOCKET m_socket;
//---- initialized winsock 2
if(WSAStartup(MAKEWORD(2, 0),&wsa)!=0)
{
printf("Winsock initialization failed\n");
return(-1);
}
//---- start the server
if((m_socket=socket(AF_INET,SOCK_STREAM,0))==INVALID_SOCKET)
{
printf("SocketServer: invalid socket (WSAStartup is missing?)\n");
return(FALSE);
}
closesocket(m_socket);
m_socket=INVALID_SOCKET;
WSACleanup();
return(0);
}
тестировал на Rational Purify ,ниже лог, тут по любому что то с сокетами не так я делаю
[I] Starting main
[I] Summary of all memory leaks... {932 bytes, 2 blocks}
[I] MPK: Potential memory leak of 896 bytes from 1 block allocated in EnumerateSecurityPackagesW [SECUR32.DLL]
Offset 0x000000b4 referenced by 0x0017a13c, a location in a HeapAlloc'd block
Offset 0x000000c8 referenced by 0x0017a140, a location in a HeapAlloc'd block
Offset 0x00000102 referenced by 0x0017a158, a location in a HeapAlloc'd block
Offset 0x00000114 referenced by 0x0017a15c, a location in a HeapAlloc'd block
Offset 0x00000144 referenced by 0x0017a174, a location in a HeapAlloc'd block
Offset 0x0000014e referenced by 0x0017a178, a location in a HeapAlloc'd block
Offset 0x0000017a referenced by 0x0017a190, a location in a HeapAlloc'd block
Offset 0x000001d4 referenced by 0x0017a194, a location in a HeapAlloc'd block
Offset 0x0000022e referenced by 0x0017a1ac, a location in a HeapAlloc'd block
Offset 0x00000240 referenced by 0x0017a1b0, a location in a HeapAlloc'd block
Distribution of potentially leaked blocks
896 bytes from 1 block of 896 bytes (0x00179d88)
Allocation location
LocalAlloc [C:\WINDOWS\system32\KERNEL32.DLL]
EnumerateSecurityPackagesW [C:\WINDOWS\system32\SECUR32.DLL]
[W] MLK: Memory leak of 36 bytes from 1 block allocated in QuerySecurityPackageInfoW [SECUR32.DLL]
Distribution of leaked blocks
Allocation location
LocalAlloc [c:\WINDOWS\system32\KERNEL32.DLL]
QuerySecurityPackageInfoW [C:\WINDOWS\system32\SECUR32.DLL]
[I] Exiting with code 0 (0x00000000)
Process time: 281 milliseconds
[I] Program terminated at 06.09.2009 22:43:33
Помогите плз разобраться