Device.Dispose變更為virtual