2015-10-16 11 views
5

VLD'yi denediğim herhangi bir bellek sızıntısı yakalayamıyorum. Herhangi bir fikir neden? Burada çıktının snippet'i de:Visual Leak Detector sızıntıları bulamıyor VS2013

Neyi eksik?

Visual Leak Detector Version 2.4RC2 installed. 
The thread 0x5748 has exited with code 0 (0x0). 
The thread 0x2c70 has exited with code 0 (0x0). 
The thread 0x3c98 has exited with code 0 (0x0). 
No memory leaks detected. 
Visual Leak Detector is now exiting. 
The program '[24988] ConsoleApplication2.exe' has exited with code 0 (0x0). 


#include <vld.h> 

#include <iostream> 
using namespace std; 

class Car{ 
    public: 
     Car() {} 

     Car(string model,int year, string color) { 
      this->model = model; this->color, this->year = year; 
     } 

     string getModel() { 
      return this->model; 
     } 

     void setModel(string m) { 
      this->model = model; 
     } 

     string getColor() { 
      return this->color; 
     } 

     void setColor(string color) { 
      this->color = color; 
     } 

     void paint() 
     { 
      setColor("white"); 
     } 

    private: 
     string model; 
     int year; 
     string color; 
}; 


int _tmain(int argc, _TCHAR* argv[]){ 
    Car c("bmw", 2000, "red"); 
    c.paint(); 
    cout << c.getColor().c_str(); 

    for (int i = 0; i < 10; i++) 
     int *ptr = new int(10); 

    Car *c2 = new Car("benz", 2010, "yellow"); 

    return 0; 
} 

cevap

3

O Bir konsol modunda programı çalıştırmak zorunda visual studio 2013 ultimate

altında çalışıyor

(projenin ayıklama dizinine gidin) Aşağıda, sonucun bir resmini bulacaksınız, ancak konsol burada hepsini göremediğimiz çok fazla sızıntı görüldü

Ben include ve projeye lib yolları ayarı eklendi

  1. C: \ Görsel Kaçak Dedektörü \ \ ​​Program Files (x86)
  2. C şunlardır: \ Görsel Kaçak Dedektörü \ \ ​​Program Files (x86) lib \ win32
  3. C: \ Program Files (x86) burada gördüğünüz gibi Görsel Kaçak Dedektörü \ lib \ Win64

enter image description here

\ 13 bellek sızıntısıdır.

İlgili konular