diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-06-14 13:50:43 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2013-02-16 23:51:49 (GMT) |
commit | a6d328597c50f2e9c77cf6ecfb7b66c34b148057 (patch) | |
tree | 14f85201b89e0babb82a5dbffa8dbb14576a8a04 /src/FbTk | |
parent | fd3886025a9715a9d82319ebb6220925cf3f2744 (diff) | |
download | fluxbox_pavel-a6d328597c50f2e9c77cf6ecfb7b66c34b148057.zip fluxbox_pavel-a6d328597c50f2e9c77cf6ecfb7b66c34b148057.tar.bz2 |
Make lua resource manager automatically initialize lua state if needed
Diffstat (limited to 'src/FbTk')
-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 | } |