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

Memory leaks with Scene.new #61

Open
Watson1978 opened this issue Dec 6, 2016 · 0 comments
Open

Memory leaks with Scene.new #61

Watson1978 opened this issue Dec 6, 2016 · 0 comments
Labels

Comments

@Watson1978
Copy link
Member

  1. Scene.new will call scene_alloc
    scene_alloc(VALUE rcv, SEL sel)
    {
    auto layer = mc_Scene::create();
    auto scene = cocos2d::Scene::createWithPhysics();
    scene->addChild(layer);
    layer->scene = scene;
    VALUE obj = rb_class_wrap_new((void *)layer, rcv);
    layer->obj = rb_retain(obj);
    return obj;
    }
  2. mc_Scene::create(); creates C++ instance
    auto scene = new mc_Scene();

However, there is not delete anywhere.

@Watson1978 Watson1978 added the Leak label Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant