From 7e51ff3bfae0becc260452a427a1fc1232a4b348 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 15 Nov 2018 19:29:27 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/common/je_lua_function.cpp | 0 src/lua/common/je_lua_function.h | 6 ++++++ src/lua/common/je_lua_proxy.h | 5 +++-- src/lua/common/je_lua_shared.hpp | 7 ++++++- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 src/lua/common/je_lua_function.cpp create mode 100644 src/lua/common/je_lua_function.h (limited to 'src/lua/common') diff --git a/src/lua/common/je_lua_function.cpp b/src/lua/common/je_lua_function.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/lua/common/je_lua_function.h b/src/lua/common/je_lua_function.h new file mode 100644 index 0000000..49c1b31 --- /dev/null +++ b/src/lua/common/je_lua_function.h @@ -0,0 +1,6 @@ +#ifndef __JE_LUA_FUNCTION_H__ +#define __JE_LUA_FUNCTION_H__ + + + +#endif \ No newline at end of file diff --git a/src/lua/common/je_lua_proxy.h b/src/lua/common/je_lua_proxy.h index 9f55490..ca4a56a 100644 --- a/src/lua/common/je_lua_proxy.h +++ b/src/lua/common/je_lua_proxy.h @@ -18,6 +18,7 @@ namespace JinEngine if (s == nullptr) return; shared = s; + shared->retain(); } void release() @@ -28,13 +29,13 @@ namespace JinEngine shared = nullptr; } } - +/* void retain() { if (shared != nullptr) shared->retain(); } - +*/ template Shared& getShared() { diff --git a/src/lua/common/je_lua_shared.hpp b/src/lua/common/je_lua_shared.hpp index 9cd7073..91705d1 100644 --- a/src/lua/common/je_lua_shared.hpp +++ b/src/lua/common/je_lua_shared.hpp @@ -85,12 +85,17 @@ namespace JinEngine return mDependencies.find(key)->second; } + bool isType(const char* t) + { + return strcmp(type, t) == 0; + } + protected: using DepMap = std::map; SharedBase(void* obj, const char* t) - : mCount(1) + : mCount(0) , mObject(obj) , type(t) { -- cgit v1.1-26-g67d0