Projectkk2glider/issue 4099 leaks (#4617)
* Re #4099: memory leaks on model select screen fixed [Horus] * Re #4099: memory leak in wizard background image [Horus]
This commit is contained in:
committed by
Bertrand Songis
parent
0020941740
commit
b965cac481
@@ -36,6 +36,13 @@ class ModelCell
|
||||
strncpy(this->modelFilename, name, sizeof(this->modelFilename));
|
||||
}
|
||||
|
||||
~ModelCell()
|
||||
{
|
||||
if (buffer) {
|
||||
delete buffer;
|
||||
}
|
||||
}
|
||||
|
||||
const BitmapBuffer * getBuffer()
|
||||
{
|
||||
if (!buffer) {
|
||||
@@ -100,6 +107,14 @@ class ModelsCategory: public std::list<ModelCell *>
|
||||
strncpy(this->name, name, sizeof(this->name));
|
||||
}
|
||||
|
||||
~ModelsCategory()
|
||||
{
|
||||
for (std::list<ModelCell *>::iterator it = begin(); it != end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ModelCell * addModel(const char * name)
|
||||
{
|
||||
ModelCell * result = new ModelCell(name);
|
||||
|
||||
Reference in New Issue
Block a user