Should set _mtlCommandBuffer to nil after release

This commit is contained in:
HALX99 2020-09-03 22:26:21 +08:00 committed by GitHub
parent 047bcae9ea
commit 36c25dc889
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
/****************************************************************************
Copyright (c) 2018-2019 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2020 c4games.com
http://www.cocos2d-x.org
@ -370,6 +371,8 @@ void CommandBufferMTL::endFrame()
[_mtlCommandBuffer commit];
[_mtlCommandBuffer release];
_mtlCommandBuffer = nil;
DeviceMTL::resetCurrentDrawable();
[_autoReleasePool drain];
}