Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#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