Skip to content
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

fix FontAtlas crash on some Android devices #18145

Merged
merged 2 commits into from
Aug 16, 2017

Conversation

newnon
Copy link
Contributor

@newnon newnon commented Aug 10, 2017

fix #17390

@@ -111,6 +111,8 @@ class CC_DLL FontAtlas : public Ref
protected:
void reset();

void reinit();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why to set this file to 100755?

@newnon
Copy link
Contributor Author

newnon commented Aug 14, 2017

i think it was mistake

@@ -132,6 +146,8 @@ void FontAtlas::reset()
_currentPageOrigX = 0;
_currentPageOrigY = 0;
_letterDefinitions.clear();

reinit();
Copy link
Contributor

@minggo minggo Aug 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why need to reinit when it is destroyed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be its wrong and this code is not needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is not needed, then there is not difference from previous codes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it is my fault, it is added in reset. The github diff doesn't look good.

Copy link
Contributor Author

@newnon newnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is just adapted code form @SBJoker
i have tested this code in my game and it fixes crash

@@ -132,6 +146,8 @@ void FontAtlas::reset()
_currentPageOrigX = 0;
_currentPageOrigY = 0;
_letterDefinitions.clear();

reinit();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be its wrong and this code is not needed

@minggo minggo merged commit afbf26e into cocos2d:v3 Aug 16, 2017
stevetranby added a commit to stevetranby/cocos2d-x that referenced this pull request Aug 23, 2017
* commit 'e79f21cec02ebbffbf08150708ed26e524c1faf2':
  add new CMakeLists.txt to cpp-template-default (https://gist.github.com/MrCapone/ccdc1826cb7362086107e8096bfe6f90) (cocos2d#18167)
  Fixes compilation errors for android audio module while building with x86 arch. (cocos2d#18150)
  fixed GLViewImpl::getMonitorSize() for desktop platforms (cocos2d#18141)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#18183)
  Fix android problem (cocos2d#18142)
  fix for ios audio engine (cocos2d#18146)
  fix android problem with 24 bit depth buffer on some devices (cocos2d#18148)
  Blend function for UIImageView (cocos2d#18149)
  Fix alpha blending during the animation of TransitionCrossFade. (cocos2d#18175)
  fixed cocos2d#17989: touch stops responding on android devices. (cocos2d#18165)
  [ci skip]update version and readme (cocos2d#18169)
  fix FontAtlas crash on some Android devices (cocos2d#18145)
  Add game-controller-test for win32 (cocos2d#18164)
  Fix android compile fail bug (cocos2d#18166)

# Conflicts:
#	cocos/audio/android/cutils/bitops.h
#	cocos/audio/apple/AudioEngine-inl.mm
@newnon newnon deleted the v3_android_fix_crash_on_restore branch January 17, 2018 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash on Android after restore from background in Texture2D::updateWithData
3 participants