Mathias Fröhlich:
I guess the most important memory leaks are plugged now. Just by inspection: An other memory leak in Simgear.
This commit is contained in:
@@ -110,7 +110,7 @@ SGMatModel::~SGMatModel ()
|
|||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < _models.size(); i++) {
|
for (unsigned int i = 0; i < _models.size(); i++) {
|
||||||
if (_models[i] != 0) {
|
if (_models[i] != 0) {
|
||||||
_models[i]->deRef();
|
ssgDeRefDelete(_models[i]);
|
||||||
_models[i] = 0;
|
_models[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ SGModelLib::~SGModelLib ()
|
|||||||
{
|
{
|
||||||
map<string, ssgBase *>::iterator it = _table.begin();
|
map<string, ssgBase *>::iterator it = _table.begin();
|
||||||
while (it != _table.end()) {
|
while (it != _table.end()) {
|
||||||
it->second->deRef();
|
ssgDeRefDelete(it->second);
|
||||||
_table.erase(it);
|
_table.erase(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ SGModelLib::flush1()
|
|||||||
// If there is only one reference, it's
|
// If there is only one reference, it's
|
||||||
// ours; no one else is using the item.
|
// ours; no one else is using the item.
|
||||||
if (item->getRef() == 1) {
|
if (item->getRef() == 1) {
|
||||||
item->deRef();
|
ssgDeRefDelete(item);
|
||||||
_table.erase(it);
|
_table.erase(it);
|
||||||
}
|
}
|
||||||
it++;
|
it++;
|
||||||
|
|||||||
Reference in New Issue
Block a user