New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Test Case: UIButton::loadTextureNormal 2nd time error #18611
base: v3
Are you sure you want to change the base?
Conversation
…ameName render error
You said fixing this issue need to modify |
I thought you wanted a test case to see what was the error. I will commit my temporary fix later. |
please see CI log to solve the checks failed @peerobo |
@drelaptop please check my fix if you have time. Thanks. |
_buttonDisabledRenderer->initWithSpriteFrameName(disabled); | ||
// _buttonDisabledRenderer->initWithSpriteFrameName(disabled); | ||
frm = SpriteFrameCache::getInstance()->getSpriteFrameByName(disabled); | ||
_buttonDisabledRenderer->setSpriteFrame(frm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirm the issue existed, we need fix it. do you know why it happened? I am not sure this way fixing the bug is best.
one reason is in initWithSpriteFrameName
called SpriteFrameCache::getInstance()->getSpriteFrameByName(disabled);
, setSpriteFrame
and the other method, so I think the bug is caused due to internal of initWithSpriteFrameName
.
another reason is initWithSpriteFrameName
do many checks, calling getSpriteFrameByName
and setSpriteFrame
directly do no checks, if I code:
spr->loadTextureNormal("Not Existed Texture", ui::Widget::TextureResType::PLIST);
the app will crash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the issue is within initWithSpriteFrameName()
but I do not have time right now to debug. This is a temporary fix to make my project work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understand, and I am doing something about cmake firstly, so let it stay here for now.
Test case for this issue
#18609