diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index a09d56b4ed..1761ca311a 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -677,8 +677,8 @@ static void GLToClipTransform(Mat4 *transformOut) Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when setting matrix stack"); - auto projection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); - auto modelview = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); + auto& projection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); + auto& modelview = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); *transformOut = projection * modelview; }