AnimationSystem memory leaks???

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

wang37921
Just popping in
Just popping in
Posts: 20
Joined: Thu Dec 24, 2009 11:22
Contact:

AnimationSystem memory leaks???

Postby wang37921 » Thu Dec 09, 2010 08:14

hi ce~
i'm not sure, is this cegui's memory leaks..
But, i has exclude my code step by step..finally find when i add blow code will bring memory leaks..

Code: Select all

   CEGUI::AnimationManager& animMgr = CEGUI::AnimationManager::getSingleton();
   animMgr.loadAnimationsFromXML("GuiFuncBtns.xml");


I am a green hand~so i'm not sure this is right. .waiting for your answer.. :oops:
so, i go into cegui code page, and find many about animationsystem's class, they don't clear their members..
like:

Code: Select all

//----------------------------------------------------------------------------//
void Animation::destroyAffector(Affector* affector)
{
    AffectorList::iterator it =
        std::find(d_affectors.begin(), d_affectors.end(), affector);

    if (it == d_affectors.end())
    {
        CEGUI_THROW(InvalidRequestException(
                        "Animation::destroyAffector: Given affector not found!"));
    }

    d_affectors.erase(it);
}

//----------------------------------------------------------------------------//

and

Code: Select all

//----------------------------------------------------------------------------//
void AnimationManager::destroyAnimation(const String& name)
{
    AnimationMap::iterator it = d_animations.find(name);

    if (it == d_animations.end())
    {
        CEGUI_THROW(UnknownObjectException(
            "AnimationManager::destroyAnimation: Animation with given name not "
            "found."));
    }

    Animation* animation = it->second;
    destroyAllInstancesOfAnimation(animation);

    d_animations.erase(it);
    delete animation;
}

wang37921
Just popping in
Just popping in
Posts: 20
Joined: Thu Dec 24, 2009 11:22
Contact:

Re: AnimationSystem memory leaks???

Postby wang37921 » Thu Dec 09, 2010 08:19

sorry~void AnimationManager::destroyAnimation(const String& name),has delete anim~
destroyAnimationInstance, havn't deleted animInst...

Code: Select all

//----------------------------------------------------------------------------//
void AnimationManager::destroyAnimationInstance(AnimationInstance* instance)
{
    AnimationInstanceMap::iterator it =
        d_animationInstances.find(instance->getDefinition());

    for (; it != d_animationInstances.end(); ++it)
    {
        if (it->second == instance)
        {
            d_animationInstances.erase(it);
            return;
        }
    }

    CEGUI_THROW(InvalidRequestException(
        "AnimationManager::destroyAnimationInstance: Given animation instance "
        "not found."));
}

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: AnimationSystem memory leaks???

Postby Kulik » Thu Dec 09, 2010 12:34

Thanks and kudos! Good catch :) . I have fixed both mem leak bugs for 0.8 in svn r2745. I will backport them to 0.7 if necessary (I am not sure if there will be any more 0.7 minor releases but it's likely).

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: AnimationSystem memory leaks???

Postby Jamarr » Fri Dec 10, 2010 00:23

Please post in the appropriate sub-forum, as this keeps threads organized and avoids cluttering sub-forums with unrelated content. It's not that hard. Thanks.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

wang37921
Just popping in
Just popping in
Posts: 20
Joined: Thu Dec 24, 2009 11:22
Contact:

Re: AnimationSystem memory leaks???

Postby wang37921 » Fri Dec 10, 2010 02:05

Jamarr wrote:Please post in the appropriate sub-forum, as this keeps threads organized and avoids cluttering sub-forums with unrelated content. It's not that hard. Thanks.

my english is poor, so sorry for that, i will try my best to do that... :(


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 16 guests