mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
memory leaks
This commit is contained in:
parent
31b07f8625
commit
325d3265b9
@ -15,6 +15,7 @@ public:
|
|||||||
float duration;
|
float duration;
|
||||||
|
|
||||||
Animation (const std::vector<Timeline*> &timelines, float duration);
|
Animation (const std::vector<Timeline*> &timelines, float duration);
|
||||||
|
~Animation();
|
||||||
|
|
||||||
void apply (BaseSkeleton *skeleton, float time, bool loop);
|
void apply (BaseSkeleton *skeleton, float time, bool loop);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -71,6 +71,7 @@ public:
|
|||||||
int *splits;
|
int *splits;
|
||||||
int *pads;
|
int *pads;
|
||||||
|
|
||||||
|
BaseAtlasRegion() : splits(0), pads(0) {}
|
||||||
virtual ~BaseAtlasRegion ();
|
virtual ~BaseAtlasRegion ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -31,6 +31,7 @@ public:
|
|||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
Skin (const std::string &name);
|
Skin (const std::string &name);
|
||||||
|
~Skin();
|
||||||
|
|
||||||
void addAttachment (int slotIndex, const std::string &name, Attachment *attachment);
|
void addAttachment (int slotIndex, const std::string &name, Attachment *attachment);
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,14 @@ Animation::Animation (const vector<Timeline*> &timelines, float duration) :
|
|||||||
duration(duration) {
|
duration(duration) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Animation::~Animation()
|
||||||
|
{
|
||||||
|
for (std::vector<Timeline*>::iterator iter = timelines.begin(); iter != timelines.end(); ++iter)
|
||||||
|
{
|
||||||
|
delete *iter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Animation::apply (BaseSkeleton *skeleton, float time, bool loop) {
|
void Animation::apply (BaseSkeleton *skeleton, float time, bool loop) {
|
||||||
if (!skeleton) throw std::invalid_argument("skeleton cannot be null.");
|
if (!skeleton) throw std::invalid_argument("skeleton cannot be null.");
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,8 @@ BaseSkeletonJson::BaseSkeletonJson (BaseAttachmentLoader *attachmentLoader) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
BaseSkeletonJson::~BaseSkeletonJson () {
|
BaseSkeletonJson::~BaseSkeletonJson () {
|
||||||
|
if (attachmentLoader)
|
||||||
|
delete attachmentLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkeletonData* BaseSkeletonJson::readSkeletonData (std::ifstream &file) const {
|
SkeletonData* BaseSkeletonJson::readSkeletonData (std::ifstream &file) const {
|
||||||
|
|||||||
@ -8,6 +8,13 @@ Skin::Skin (const std::string &name) :
|
|||||||
name(name) {
|
name(name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Skin::~Skin()
|
||||||
|
{
|
||||||
|
for (std::map<Key, Attachment*>::iterator iter = attachments.begin(); iter != attachments.end(); ++iter) {
|
||||||
|
delete iter->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Skin::addAttachment (int slotIndex, const std::string &name, Attachment *attachment) {
|
void Skin::addAttachment (int slotIndex, const std::string &name, Attachment *attachment) {
|
||||||
Key key = {slotIndex, name};
|
Key key = {slotIndex, name};
|
||||||
attachments[key] = attachment;
|
attachments[key] = attachment;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user