diff options
author | Mattes D <github@xoft.cz> | 2016-06-12 18:11:40 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-06-27 20:51:52 +0200 |
commit | 257c5a1a54396a3610f63bf469d6cf50ec76aef5 (patch) | |
tree | f4609bd58206783c9809455f5567cc4aa2ef512d /src/Bindings/LuaState.cpp | |
parent | LuaState: Implemented proper locking for cCallback. (diff) | |
download | cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.gz cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.bz2 cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.lz cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.xz cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.tar.zst cuberite-257c5a1a54396a3610f63bf469d6cf50ec76aef5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/LuaState.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index 85c6c2e12..0d958cc20 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -1021,6 +1021,10 @@ bool cLuaState::GetStackValue(int a_StackPos, cCallback & a_Callback) bool cLuaState::GetStackValue(int a_StackPos, cCallbackPtr & a_Callback) { + if (a_Callback == nullptr) + { + a_Callback = std::make_shared<cCallback>(); + } return a_Callback->RefStack(*this, a_StackPos); } |