zdzhaoyong/GSLAM

GImage.data not nullptr after release

Opened this issue · 0 comments

When I added this test for GImage, after the destruct function called, the data pointer are not equal with nullptr. That's why?


TEST(GImageTest,CorrectRelease)
{
    GSLAM::GImage img(10,10,GSLAM::GImageType<uchar,1>::Type);
    {
        GSLAM::GImage img2=img;
    }
    EXPECT_FALSE(img.empty());
    EXPECT_EQ(1,*img.refCount);
    EXPECT_TRUE(img.data);
    img.~GImage();
    EXPECT_EQ(NULL,img.refCount);
    EXPECT_TRUE(img.data==nullptr);// FIXME: why not equal nullptr
    EXPECT_TRUE(img.empty());
}