The following code is crashing at the call to set_color. What am I doing wrong here?
PT(AmbientLight) aLight01;
aLight01 = new AmbientLight("aLight01");
aLight01->set_color(Colorf(0.2, 0.2, 0.2, 1));
NodePath aLight01np = window->get_render().attach_new_node(aLight01);
window->get_render().set_light(aLight01np);