GL: fixed crash through early deconstruction