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

Body.DestroyShape Clobers All Shapes #10

Open
GoogleCodeExporter opened this issue Feb 6, 2016 · 0 comments
Open

Body.DestroyShape Clobers All Shapes #10

GoogleCodeExporter opened this issue Feb 6, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Add two shapes to a body
2. Delete the first one using DestroyShape
3. Delete the second one using DestroyShape

What is the expected output? What do you see instead?
Expected: Both shapes to be deleted.
Saw: First delete clobbers the shape list.

What version of the product are you using? On what operating system?
SVN Revision 56 (6/11/2008).  Development Platform: Windows XP.  Target 
Platforms: XNA on PC and XBox.

Please provide any additional information below.
Looks like this has been ported correctly but the original code has a bug.  
This has been fixed in the latest flash version.  Not sure if it is fixed 
in the C++ version.

Here is the code patched with the Flash Fix:

            Shape ppS = null; // Fix pointer-pointer stuff
            bool found = false;

            while (node != null)
            {
                if (node == shape)
                {
                    if (ppS != null)
                    {
                        ppS._next = shape._next;
                    }
                    else
                    {
                        _shapeList = shape._next;
                    }
                    //node = s.m_next;
                    found = true;
                    break;
                }

                ppS = node;
                node = node._next;
            }


Original issue reported on code.google.com by dale.fr...@gmail.com on 16 Jan 2009 at 4:05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant