Fix graphics resource disposing performance