From f44cbaa0449e833f5bfcacd0e73e01261ea525da Mon Sep 17 00:00:00 2001 From: badlogic Date: Thu, 24 Nov 2016 15:29:45 +0100 Subject: [PATCH] [c] Added spAnimationState_disposeStatics to appease memory leak detectors. --- spine-c/include/spine/AnimationState.h | 3 +++ spine-c/src/spine/AnimationState.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/spine-c/include/spine/AnimationState.h b/spine-c/include/spine/AnimationState.h index f12d52dde..ebfba21f8 100644 --- a/spine-c/include/spine/AnimationState.h +++ b/spine-c/include/spine/AnimationState.h @@ -138,6 +138,9 @@ void spAnimationState_clearListenerNotifications(spAnimationState* self); float spTrackEntry_getAnimationTime (spTrackEntry* entry); +/** Use this to dispose static memory before your app exits to appease your memory leak detector*/ +void spAnimationState_disposeStatics (); + #ifdef SPINE_SHORT_NAMES typedef spEventType EventType; #define ANIMATION_START SP_ANIMATION_START diff --git a/spine-c/src/spine/AnimationState.c b/spine-c/src/spine/AnimationState.c index 0df584f1d..71afef707 100644 --- a/spine-c/src/spine/AnimationState.c +++ b/spine-c/src/spine/AnimationState.c @@ -33,6 +33,9 @@ #include static spAnimation* SP_EMPTY_ANIMATION = 0; +void spAnimationState_disposeStatics () { + FREE(SP_EMPTY_ANIMATION); +} /* Forward declaration of some "private" functions so we can keep the same function order in C as we have method order in Java */