]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/lighting.cpp
Fix loading of inline materials and lights
[libs/gl.git] / source / materials / lighting.cpp
index 3057d20d77baaccd1e00804ad37521868ff5c342..f6bb39ffce98ecd701b901c223bf1244e415a9ae 100644 (file)
@@ -144,9 +144,8 @@ void Lighting::Loader::light_inline()
 {
        Light::GenericLoader ldr(get_collection());
        load_sub_with(ldr);
-       RefPtr<Light> 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