lundi 5 février 2018

Finding Memory leaks in VS 2013 release build while using Deleaker in the following code. Are they really memory leaks?

I am using Deleaker tool to find the memory leaks in my application.

Below are the code snippet files where I am getting the memory leaks.

class FileManager {

.....
std::fstream _dfs;
std::mutex _dmutex;
Write(const char *l_charbuffer);
.....

};

void FileManager::Write(const char *l_charbuffer) {

std::unique_lock<std::mutex> lock(_dmutex);
_dfs << l_charbuffer << endl;

}

class LogManager {

.....
Initialize(const char *l_charbuffer);
.....

};

LogManager::Initialize() {

.....
std::thread logexcpthread(&LogManager::ExcpThread, this);
.....

}

When I am running my application in the Release build, Deleaker tool has shown memory leaks in the following lines:

std::unique_lock lock(_dmutex); // Write method of FileManager

std::thread logexcpthread(&LogManager::ExcpThread, this); // Initialize method of LogManager

I am not sure are those really memory leaks or not? If anyone has come across this kind of problem, please help me on this?

Is there a tool limitation in Release build for this kind of code?

Note: But I have not seen these memory leaks in Debug build.

Aucun commentaire:

Enregistrer un commentaire