]> git.tdb.fi Git - libs/gl.git/blobdiff - source/light.cpp
Unbind things if they are deleted while current
[libs/gl.git] / source / light.cpp
index 11f4826cd74748acde5b1bfba24d8efd32ea3203..968bffdf74894723bc620666bd56865b366637eb 100644 (file)
@@ -24,6 +24,12 @@ Light::Light():
        attenuation[2] = 0;
 }
 
+Light::~Light()
+{
+       while(LightUnit *unit = LightUnit::find_unit(this))
+               unbind_from(unit->get_index());
+}
+
 void Light::update_parameter(int mask, int index) const
 {
        if(index<0)