mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +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)) {
|
||||
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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user