Skip to content

Commit

Permalink
Remove MEMLEAKFINDER_NOT_A_LEAK from FileStream
Browse files Browse the repository at this point in the history
It's not clear why we need to tell the memory leak tracking system to ignore
FileStream objects if they raise an exception in their constructors. The
objects should still be destroyed normally. Additionally, now that we
allocate more of them on the heap (for NamedLock), this can cause later
allocations to be silently ignored as not-leaks, which is causing
test_memory_leak_detection to fail.
  • Loading branch information
qris committed Dec 17, 2017
1 parent d671450 commit 24386d9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/common/FileStream.cpp
Expand Up @@ -120,8 +120,6 @@ void FileStream::OpenFile(int flags, int mode, lock_mode_t lock_mode)

if(mOSFileHandle == INVALID_FILE)
{
MEMLEAKFINDER_NOT_A_LEAK(this);

// Failed to open the file. What's the reason? The errno which indicates a lock
// conflict depends on the locking method.

Expand Down Expand Up @@ -225,7 +223,6 @@ FileStream::FileStream(tOSFileHandle FileDescriptor)
{
if(mOSFileHandle == INVALID_FILE)
{
MEMLEAKFINDER_NOT_A_LEAK(this);
BOX_ERROR("FileStream: called with invalid file handle");
THROW_EXCEPTION(CommonException, OSFileOpenError)
}
Expand All @@ -250,7 +247,6 @@ FileStream::FileStream(const FileStream &rToCopy)
if(mOSFileHandle < 0)
#endif
{
MEMLEAKFINDER_NOT_A_LEAK(this);
BOX_ERROR("FileStream: copying unopened file");
THROW_EXCEPTION(CommonException, OSFileOpenError)
}
Expand Down

0 comments on commit 24386d9

Please sign in to comment.