Make love::Exception safe(r).

Now allows exceptions of arbitrary length.
Now allows catching a non-reference, i.e. catch(love::Exception e).
This commit is contained in:
vrld
2011-11-12 21:11:41 +01:00
parent 03927f5207
commit 7a513e1434
4 changed files with 37 additions and 26 deletions
+2 -2
View File
@@ -177,7 +177,7 @@ namespace opengl
catch (utf8::exception & e)
{
glPopMatrix();
throw love::Exception(1, e.what());
throw love::Exception("%s", e.what());
}
glPopMatrix();
}
@@ -212,7 +212,7 @@ namespace opengl
}
catch (utf8::exception & e)
{
throw love::Exception(1, e.what());
throw love::Exception("%s", e.what());
}
return temp;
@@ -388,7 +388,7 @@ namespace opengl
const char* code = lua_tostring(L, -1);
PixelEffect * effect = instance->newPixelEffect(code);
luax_newtype(L, "PixelEffect", GRAPHICS_PIXELEFFECT_T, (void*)effect);
} catch (love::Exception& e) {
} catch (const love::Exception& e) {
// memory is freed in Graphics::newPixelEffect
luax_getfunction(L, "graphics", "_transformGLSLErrorMessages");
lua_pushstring(L, e.what());