diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-06-14 13:50:43 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-06-15 23:12:53 (GMT) |
commit | 60a0dc4890afc3783474eb92c303e0b22c1ac270 (patch) | |
tree | 92b5715e5c0b383c18a750450b7f24fa6c12f97e /src/FbTk/LResource.cc | |
parent | 0271b1421c8caf9eb929a64e073fa3f57f697ed9 (diff) | |
download | fluxbox_pavel-60a0dc4890afc3783474eb92c303e0b22c1ac270.zip fluxbox_pavel-60a0dc4890afc3783474eb92c303e0b22c1ac270.tar.bz2 |
Make lua resource manager automatically initialize lua state if needed
Diffstat (limited to 'src/FbTk/LResource.cc')
-rw-r--r-- | src/FbTk/LResource.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/FbTk/LResource.cc b/src/FbTk/LResource.cc index 2e2a7c7..b91f0d8 100644 --- a/src/FbTk/LResource.cc +++ b/src/FbTk/LResource.cc | |||
@@ -104,6 +104,11 @@ LResourceManager::LResourceManager(const std::string &root, lua::state &l) | |||
104 | lua::stack_sentry s(l); | 104 | lua::stack_sentry s(l); |
105 | 105 | ||
106 | l.getfield(lua::REGISTRYINDEX, make_root); | 106 | l.getfield(lua::REGISTRYINDEX, make_root); |
107 | if(l.isnil(-1)) { | ||
108 | l.pop(); | ||
109 | initState(l); | ||
110 | l.getfield(lua::REGISTRYINDEX, make_root); | ||
111 | } | ||
107 | l.pushstring(root); | 112 | l.pushstring(root); |
108 | l.call(1, 0); | 113 | l.call(1, 0); |
109 | } | 114 | } |