Skip to content

Memory Leak #220

Open
Open
@dcRolls

Description

@dcRolls

This is a great tool. I've found, however, that the code appears to leak memory. I understand that it consumes memory to track the function calls, but when I limit scope by putting braces around a block of code which uses mocking, I still end up with an increase in memory, the size of which depends on the number of methods you are mocking. This is true even if I never actually call those methods.

`//Record initial memory footprint here:

     { //limit scope
        std::vector<IMySolid*> myObjs;
        Mock<IMySolid> mock;
        Method(mock, getShapeCount) = 1;
        Method(mock, getShapeCategory) = 1;
        myObjs.push_back(&mock.get());
                    
        for (std::vector<IMySolid*>::const_iterator it = myObjs.begin(); it != myObjs.end(); it++)
        {
           ;//don't actually call either mocked method             
        }
     } //end of scope 

//record new memory footprint here... this leads to an increase in memory of 119 bytes, when the same
code executed with the real solid results in no memory increase.`

Am I doing something wrong, or is there a memory leak?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions