hmm.. that does fix it.. you are right.. i did not have a virtual
>
>
>
>
>
> On Tue, Apr 20, 2010 at 1:37 PM, blah blah <
sras...@gmail.com> wrote:
> > Hi,
>
> > I am trying to use gmock in a simple sample that has a MyShapeUser
> > class that takes over the ownership of DI passed in pointer of
> > shapemock. it frees it. but Googlemock returns me an error saying
> > "\myshapeusertest.cpp(23): ERROR: this mock object should be deleted
> > but never is. Its address is @001FF450.
> > ERROR: 1 leaked mock object found at program exit."
>
> > ShapeMock* pshapemock = new ShapeMock();
> > EXPECT_CALL(*pshapemock, Area())
> > .Times(1)
> > .WillOnce(Return(5));
>
> > {
> > MyShapeUser *p = new MyShapeUser ( pshapemock);
> > delete p; // the destructor cleans up
> > }
>
> > I have checked with windbg, i have stepped through the code and can
> > see that the pshapemock was deleted correctly. why is google mock
> > complaining? Am I missing something?
>
> > --
> > Subscription settings:
http://groups.google.com/group/googlemock/subscribe?hl=en
>
> --