diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-05-19 11:25:32 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-06-15 15:34:40 (GMT) |
commit | 0a1279867c33171b8a1badb01ca138c5ce20a261 (patch) | |
tree | 6fe93b62e10ea2648a65135b7db1e9952e84ec38 /src/FbTk/Luamm.cc | |
parent | 40ed6ddb69b67e0c22556f3e565e16f6a2190316 (diff) | |
download | fluxbox_pavel-0a1279867c33171b8a1badb01ca138c5ce20a261.zip fluxbox_pavel-0a1279867c33171b8a1badb01ca138c5ce20a261.tar.bz2 |
c++ lua binding: get rid of deleted functions and rvalue references
Diffstat (limited to 'src/FbTk/Luamm.cc')
-rw-r--r-- | src/FbTk/Luamm.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/FbTk/Luamm.cc b/src/FbTk/Luamm.cc index 81a8fb3..d17096f 100644 --- a/src/FbTk/Luamm.cc +++ b/src/FbTk/Luamm.cc | |||
@@ -108,10 +108,6 @@ namespace lua { | |||
108 | /* | 108 | /* |
109 | * This function is called when lua encounters an error outside of any protected | 109 | * This function is called when lua encounters an error outside of any protected |
110 | * environment | 110 | * environment |
111 | * Throwing the exception through lua code appears to work, even if it was compiled | ||
112 | * without -fexceptions. If it turns out, it fails in some conditions, it could be | ||
113 | * replaced with some longjmp() magic. But that shouldn't be necessary, as this function | ||
114 | * will not be called under normal conditions (we execute everything in protected mode). | ||
115 | */ | 111 | */ |
116 | int panic_throw(lua_State *l) | 112 | int panic_throw(lua_State *l) |
117 | { | 113 | { |
@@ -191,6 +187,17 @@ namespace lua { | |||
191 | L->pop(1); | 187 | L->pop(1); |
192 | } | 188 | } |
193 | 189 | ||
190 | exception::exception(const exception &other) | ||
191 | : std::runtime_error(other), L(other.L) | ||
192 | { | ||
193 | L->checkstack(2); | ||
194 | |||
195 | L->rawgetfield(REGISTRYINDEX, lua_exception_namespace); | ||
196 | L->rawgeti(-1, other.key); | ||
197 | key = L->ref(-2); | ||
198 | L->pop(1); | ||
199 | } | ||
200 | |||
194 | exception::~exception() throw() | 201 | exception::~exception() throw() |
195 | { | 202 | { |
196 | if(not L) | 203 | if(not L) |