Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


I can compile it, but it crashes...
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#10
RE: I can compile it, but it crashes...

(05-16-2010, 04:34 PM)Urkle Wrote: ahh yes.. the iterators.... Those have been a royal pain in the posterior. The issue is MS does their "own" implementation of them that doesn't follow the standard that everyone else follows when it comes to how erase() works.

However, for this specific issue that's not the problem.. It just seems the iteration is done incorrectly. as it = mlstBodies.erase(it); increments it so it is being double incremented (and can skip entries).. this is a bug.. I'll make a fix and push it up. And it looks like the only place that has that issue.. Good Smile

http://github.com/FrictionalGames/HPL1En...3470adfaee

Now I get a read access violation on line 161:
void iPhysicsWorld::DestroyBody(iPhysicsBody* apBody)
{
    //STLFindAndDelete(mlstBodies, apBody);
    tPhysicsBodyListIt it = mlstBodies.begin();
    for(; it != mlstBodies.end(); ++it)
    {
161:        iPhysicsBody *pBody = *it;
        if(pBody == apBody)
        {
            if(mpWorld3D) mpWorld3D->GetPortalContainer()->RemoveEntity(pBody);
            pBody->Destroy();
            hplDelete(pBody);
            mlstBodies.erase(it);
        }
    }
}

[Image: 16455.png]
05-16-2010, 08:01 PM
Find


Messages In This Thread
RE: I can compile it, but it crashes... - by MulleDK19 - 05-16-2010, 08:01 PM



Users browsing this thread: 1 Guest(s)