Make sure to release graphics resources

Change-Id: I8f078febaf81834c296eb943eb2c0cca01ee5ffa