X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterials%2Flighting.cpp;fp=source%2Fmaterials%2Flighting.cpp;h=f6bb39ffce98ecd701b901c223bf1244e415a9ae;hp=3057d20d77baaccd1e00804ad37521868ff5c342;hb=5a01404e40717c6c2cc389ed8357713e1f216f07;hpb=adc26a2e141a2853b6c5025130c46a46cece4b84 diff --git a/source/materials/lighting.cpp b/source/materials/lighting.cpp index 3057d20d..f6bb39ff 100644 --- a/source/materials/lighting.cpp +++ b/source/materials/lighting.cpp @@ -144,9 +144,8 @@ void Lighting::Loader::light_inline() { Light::GenericLoader ldr(get_collection()); load_sub_with(ldr); - RefPtr lgt = ldr.get_object(); - get_collection().add(format("%s/%d.light", FS::basename(get_source()), obj.lights.size()), lgt.get()); - obj.attach(*lgt.release()); + Light *lgt = ldr.store_object(get_collection(), format("%s/%d.light", FS::basename(get_source()), obj.lights.size())); + obj.attach(*lgt); } } // namespace GL