Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualEctara

Posted 25 April 2013 - 06:24 PM

Just out of curiosity, does this class have a destructor? If you call Foo::drop(), and it deletes the this pointer, then at the end of the scope, it calls Foo::~Foo(), this would be undefined behavior.

 

Also, the 0xfeeefef2 looks suspect. I hear that Microsoft's heap allocator implementation writes 0xFEEEFEEE in the freed memory, so it seems like you are trying to access something through an offset from a pointer that had its storage freed.


#1Ectara

Posted 25 April 2013 - 06:21 PM

Just out of curiosity, does this class have a destructor? If you call Foo::drop(), and it deletes the this pointer, then at the end of the scope, it calls Foo::~Foo(), this would be undefined behavior.


PARTNERS