Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


#ActualFLeBlanc

Posted 22 January 2013 - 10:51 AM

Clear your entity list before Game destructor is called. Any assets that rely on GManager to be released should already be destroyed by the time Game, and thus GManager, are destroyed.

 

Alternatively, you could restructure your objects to guarantee an explicit order of destruction. If GManager and EManager are explicitly new-ed in your Game constructor, they can be explicitly deleted (either through delete, or through calling reset() if they are stored in a unique or shared ptr). This way, you can guarantee that EManager is deleted first.


#1FLeBlanc

Posted 22 January 2013 - 10:33 AM

Clear your entity list before Game destructor is called. Any assets that rely on GManager to be released should already be destroyed by the time Game, and thus GManager, are destroyed.


PARTNERS