1
Vote

AvatarRenderer causes InvalidOperationException when exiting a game

description

If using an AvatarRenderer in Xbox 360 projects, AvatarRenderer's finalizer causes an InvalidOperationException when the game is exiting.
 
Call stack:
Microsoft.Xna.Framework.dll!Microsoft.Xna.Framework.GamerServices.GamerServicesDispatcher.GraphicsDeviceService.get() + 0x39 bytes
Microsoft.Xna.Framework.dll!Microsoft.Xna.Framework.GamerServices.GamerServicesDispatcher.GraphicsDevice.get()  
Microsoft.Xna.Framework.dll!Microsoft.Xna.Framework.GamerServices.AvatarRenderer.Dispose(bool disposing = false) + 0x20 bytes   
Microsoft.Xna.Framework.dll!Microsoft.Xna.Framework.GamerServices.AvatarRenderer.Finalize() + 0x7 bytes 
 
In this scenario, the GamerServicesComponent is added to the Game class via GameLoop.EnableGamerServices.
 
This problem might mean that the components aren't being disposed when the game exits. Should also check to see if the exception is being caught - maybe this isn't a crash at all.

comments