From f534058fefb45b9ef7dc5d65844e3c1e14b09d62 Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 25 Sep 2018 13:18:13 +0200 Subject: [PATCH] [ue4] Our RTTI implementation compared tags by address. That doesn't work for UE4 hot reloading, as on reload of a shared library, the new tags have an address != the tags of the old shared library. We use string comparison now, which is more robust. --- spine-cpp/spine-cpp/src/spine/RTTI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spine-cpp/spine-cpp/src/spine/RTTI.cpp b/spine-cpp/spine-cpp/src/spine/RTTI.cpp index 99c768dca..e7fec06bb 100644 --- a/spine-cpp/spine-cpp/src/spine/RTTI.cpp +++ b/spine-cpp/spine-cpp/src/spine/RTTI.cpp @@ -48,14 +48,14 @@ const std::string &RTTI::getClassName() const { } bool RTTI::isExactly(const RTTI &rtti) const { - return (this == &rtti); + return (this->_className == rtti._className); } bool RTTI::instanceOf(const RTTI &rtti) const { const RTTI *pCompare = this; while (pCompare) { - if (pCompare == &rtti) { + if (pCompare->_className == rtti._className) { return true; } @@ -63,4 +63,4 @@ bool RTTI::instanceOf(const RTTI &rtti) const { } return false; -} +} \ No newline at end of file