diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2016-11-05 17:13:04 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2016-11-05 17:13:04 +0100 |
commit | 6d6d9bc7f98591b1398491f759cd0ec9ae2cab12 (patch) | |
tree | 7f16719f9c2feb553e03c65e15fd32265fd40a99 /core/bind | |
parent | c67e3a485dedae96b82c3356d5f45ab0509d7759 (diff) |
Core: Add singleton instance to _Marshalls
Diffstat (limited to 'core/bind')
-rw-r--r-- | core/bind/core_bind.cpp | 7 | ||||
-rw-r--r-- | core/bind/core_bind.h | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 4e815d044d..b947eec8d4 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -2043,6 +2043,13 @@ _Directory::~_Directory() { memdelete(d); } +_Marshalls* _Marshalls::singleton=NULL; + +_Marshalls *_Marshalls::get_singleton() +{ + return singleton; +} + String _Marshalls::variant_to_base64(const Variant& p_var) { int len; diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 14203ae863..d86306726c 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -503,6 +503,8 @@ class _Marshalls : public Reference { OBJ_TYPE(_Marshalls,Reference); + static _Marshalls* singleton; + protected: static void _bind_methods(); @@ -510,6 +512,8 @@ protected: public: + static _Marshalls* get_singleton(); + String variant_to_base64(const Variant& p_var); Variant base64_to_variant(const String& p_str); @@ -519,7 +523,8 @@ public: String utf8_to_base64(const String& p_str); String base64_to_utf8(const String& p_str); - _Marshalls() {}; + _Marshalls() { singleton = this; } + ~_Marshalls() { singleton = NULL; } }; |