diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp index 3ac46564f..117fe55ee 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp @@ -156,6 +156,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { if (!skeletonData->_version.startsWith(SPINE_VERSION_STRING)) { char errorMsg[255]; snprintf(errorMsg, 255, "Skeleton version %s does not match runtime version %s", skeletonData->_version.buffer(), SPINE_VERSION_STRING); + delete skeletonData; setError(NULL, errorMsg, ""); return NULL; }