Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#ActualMrP

Posted 07 April 2013 - 09:41 PM

You're passing your Array object to the PrintArray function by value rather than by reference. As a result the parameter is a copy of the passed in argument (and therefore its m_array member points to the same address), so when the destructor is invoked at the end of the function the memory pointed to by both instances is deleted.


#1MrP

Posted 07 April 2013 - 09:40 PM

You're passing your Array object to the PrintArray function by value rather than by reference. As a result the parameter is a copy of the passed in argument (and therefore its m_array member points to the same memory), so when the destructor is invoked at the end of the function the memory pointed to by both instances is deleted.


PARTNERS