aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-06-14 13:50:43 (GMT)
committerPaul Tagliamonte <paultag@fluxbox.org>2012-04-07 02:10:41 (GMT)
commitb774dfee7eebf469cc9169977619bcc813088a36 (patch)
treee801a3f3dd9318510999a0590888637816d6d6c9 /src
parentea3881684a186081c56af7dd1167ae4c780a48b1 (diff)
downloadfluxbox_paul-b774dfee7eebf469cc9169977619bcc813088a36.zip
fluxbox_paul-b774dfee7eebf469cc9169977619bcc813088a36.tar.bz2
Make lua resource manager automatically initialize lua state if needed
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/LResource.cc5
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}