Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualParadigm Shifter

Posted 03 October 2013 - 04:17 PM

Yes, if you call placement new you need to call the destructor manually, via obj->~ObjectType() (since placement new didn't allocate the memory, and doesn't know where it came from, it can come from anywhere, a global pool, on the stack, etc.).

 

You never call delete on a placement new constructed object, since it wasn't created via operator new.


#2Paradigm Shifter

Posted 03 October 2013 - 04:15 PM

Yes, if you call placement new you need to call delete manually, via obj->~ObjectType() (since placement new didn't allocate the memory, and doesn't know where it came from, it can come from anywhere, a global pool, on the stack, etc.).


#1Paradigm Shifter

Posted 03 October 2013 - 04:12 PM

Yes, if you call placement new you need to call delete manually (since placement new didn't allocate the memory, it an come from anywhere, a global pool, on the stack, etc.).


PARTNERS