Skip to content

Commit 65e8fa9

Browse files
committed
Remove direct lua lib calls
1 parent c5a8d7b commit 65e8fa9

2 files changed

Lines changed: 2 additions & 18 deletions

File tree

lua_script_language.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* limitations under the License
1818
*/
1919

20+
#include <string>
21+
2022
#include "core/engine.h"
2123
#include "editor/editor_settings.h"
2224

@@ -43,20 +45,11 @@ LuaScriptLanguage::~LuaScriptLanguage() {
4345
if (this->singleton == this)
4446
this->singleton = nullptr;
4547

46-
// In case the method finish() has not been called
47-
if (this->L) {
48-
lua_close(L);
49-
this->L = nullptr;
50-
}
5148
} // TODO
5249

5350
void LuaScriptLanguage::init() {
5451
print_debug("LuaScriptLanguage::init");
5552

56-
this->L = luaL_newstate();
57-
if (this->L) {
58-
luaL_openlibs(this->L);
59-
}
6053
} // TODO
6154

6255
String LuaScriptLanguage::get_name() const {
@@ -86,10 +79,6 @@ Error LuaScriptLanguage::execute_file(const String &p_path) { // TODO
8679
void LuaScriptLanguage::finish() {
8780
print_debug("LuaScriptLanguage::finish");
8881

89-
if (this->L) {
90-
lua_close(L);
91-
this->L = nullptr;
92-
}
9382
} // TODO
9483

9584
void LuaScriptLanguage::get_reserved_words(List<String> *p_words) const {

lua_script_language.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
#pragma once
2121

2222
#include "core/os/mutex.h"
23-
#include "core/script_language.h"
2423

25-
#include "debug.h"
26-
#include "lua/lua.hpp"
2724
#include "lua_script.h"
2825

2926
class LuaScriptLanguage : public ScriptLanguage {
@@ -47,8 +44,6 @@ class LuaScriptLanguage : public ScriptLanguage {
4744
Mutex *mutex;
4845
SelfList<LuaScript>::List script_list;
4946

50-
lua_State *L;
51-
5247
public:
5348
LuaScriptLanguage();
5449
virtual ~LuaScriptLanguage();

0 commit comments

Comments
 (0)