mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[cpp] Closes #2622, fix memory leak in case of version mismatch.
This commit is contained in:
parent
0ffcc63b5e
commit
03826796b6
@ -156,6 +156,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) {
|
|||||||
if (!skeletonData->_version.startsWith(SPINE_VERSION_STRING)) {
|
if (!skeletonData->_version.startsWith(SPINE_VERSION_STRING)) {
|
||||||
char errorMsg[255];
|
char errorMsg[255];
|
||||||
snprintf(errorMsg, 255, "Skeleton version %s does not match runtime version %s", skeletonData->_version.buffer(), SPINE_VERSION_STRING);
|
snprintf(errorMsg, 255, "Skeleton version %s does not match runtime version %s", skeletonData->_version.buffer(), SPINE_VERSION_STRING);
|
||||||
|
delete skeletonData;
|
||||||
setError(NULL, errorMsg, "");
|
setError(NULL, errorMsg, "");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user