Skip to content

Commit

Permalink
fix when spine add to timer,remove from removelist (#1659)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnylanwanjun authored and pandamicro committed Jan 14, 2019
1 parent f21b8ba commit 70cf3b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cocos/editor-support/MiddlewareManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ void MiddlewareManager::update(float dt)

void MiddlewareManager::addTimer(IMiddleware* editor)
{
auto it = std::find(_removeList.begin(), _removeList.end(), editor);
if (it != _removeList.end())
{
_removeList.erase(it);
}
_updateMap[editor] = true;
}

Expand Down
11 changes: 11 additions & 0 deletions cocos/editor-support/spine-creator-support/SpineRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ void SpineRenderer::onDisable()
void SpineRenderer::stopSchedule()
{
MiddlewareManager::getInstance()->removeTimer(this);
if (_materialBuffer)
{
_materialBuffer->reset();
_materialBuffer->writeUint32(0, 0);
}

if (_debugBuffer)
{
_debugBuffer->reset();
_debugBuffer->writeFloat32(0, 0);
}
}

void SpineRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsSkeletonData)
Expand Down

0 comments on commit 70cf3b7

Please sign in to comment.