Second workaround so far: Use something like that: ---- scope(exit) glAvoidAE(glPopAttrib(mask)); ---- with ---- void glAvoidAE(lazy void Func) { Func(); } ---- That's strange.