Skip to content

Memory leaks with Scene.new #61

@Watson1978

Description

@Watson1978
  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions