Evgeniy Rojkov Major Cleanup bug
Posts 37
Added by Evgeniy Rojkov about 1 year ago

One moving CCSprite (Host), that sprite has two childrens sprites (Flare1 and Flare2). Both flares in infinite rotation, clockwise and conter-clockwise.
if i do:
Host.parent.removeChild(Host, true); //cleanup set to true

i get exception

System.Collections.Generic.KeyNotFoundException was unhandled
  Message=KeyNotFoundException
  StackTrace:
       at System.ThrowHelper.ThrowKeyNotFoundException()
       at System.Collections.Generic.Dictionary`2.get_Item(CCObject key)
       at cocos2d.CCActionManager.update(Single dt)
       at cocos2d.CCScheduler.tick(Single dt)
       at cocos2d.CCDirector.drawScene(GameTime gameTime)
       at cocos2d.CCDisplayLinkDirector.mainLoop(GameTime gameTime)
       at cocos2d.CCApplication.Draw(GameTime gameTime)
       at GameDelegate.Draw(GameTime gameTime)
       at Microsoft.Xna.Framework.Game.Draw(GameTime gameTime)
       at Microsoft.Xna.Framework.Game.DrawFrame()
       at Microsoft.Xna.Framework.Game.Tick()
       at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.GameHost.OnIdle()
       at Microsoft.Xna.Framework.MobileGameHost.RunOneFrame()
       at Microsoft.Xna.Framework.MobileGameHost.gameLoopTimer_Tick(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.DispatcherTimerWin32.TimerElapsed(IntPtr hWnd, UInt32 uMsg, IntPtr nIDEvent, UInt32 uTime)

this bug appear not always, seems like sometimes cleanup works.

update

this is major bug. any sprite with nested animated sprites (CCAction) can throws exception after removing.

Jacob Anderson RE: Major Cleanup bug
Posts 179
Location Totally Evil Entertainment - San Diego
Added by Jacob Anderson 12 months ago

You can hack around this bug with this addition at line 375 of "actions/CCActionmanager.cs":

if (!m_pTargets.ContainsKey(keys[i]))
{
// http://www.cocos2d-x.org/boards/17/topics/11072
continue;
}

There are some other major bugs I've found in the menu handlers where null pointers or unexpected class types have caused some runtime errors. I'll try to collect those and post as well.

Jacob Anderson RE: Major Cleanup bug
Posts 179
Location Totally Evil Entertainment - San Diego
Added by Jacob Anderson 10 months ago

(1-2/2)