Debugger: More memory management fixes.
DwarfImageDebugInfo: - Type name/info entries weren't being freed properly. BaseUnit: - The array of entries itself was being destroyed, but not the actual objects. Consequently none of the DIE objects were ever being freed. CfaRuleSet: - The register rules array wasn't being freed. FileManager: - References to entries weren't being released. Some more work remains to be done here though, as a subset of these objects still have a non-zero ref count in the end.
This commit is contained in:
parent
8a9e1e0d4a
commit
b1ab02c434
|
@ -267,7 +267,7 @@ struct DwarfImageDebugInfo::TypeNameEntry : TypeNameKey {
|
|||
TypeNameEntry(const BString& name)
|
||||
:
|
||||
TypeNameKey(name),
|
||||
types(10, false)
|
||||
types(10, true)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -362,6 +362,12 @@ DwarfImageDebugInfo::~DwarfImageDebugInfo()
|
|||
fFile->ReleaseReference();
|
||||
fTypeCache->ReleaseReference();
|
||||
|
||||
TypeNameEntry* entry = fTypeNameTable->Clear(true);
|
||||
while (entry != NULL) {
|
||||
TypeNameEntry* next = entry->next;
|
||||
delete entry;
|
||||
entry = next;
|
||||
}
|
||||
delete fTypeNameTable;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ BaseUnit::BaseUnit(off_t headerOffset, off_t contentOffset,
|
|||
|
||||
BaseUnit::~BaseUnit()
|
||||
{
|
||||
for (int32 i = 0; i < fEntries.Count(); i++)
|
||||
delete fEntries[i];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,6 +19,12 @@ CfaRuleSet::CfaRuleSet()
|
|||
}
|
||||
|
||||
|
||||
CfaRuleSet::~CfaRuleSet()
|
||||
{
|
||||
delete[] fRegisterRules;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
CfaRuleSet::Init(uint32 registerCount)
|
||||
{
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
class CfaRuleSet {
|
||||
public:
|
||||
CfaRuleSet();
|
||||
~CfaRuleSet();
|
||||
|
||||
status_t Init(uint32 registerCount);
|
||||
CfaRuleSet* Clone() const;
|
||||
|
|
|
@ -124,6 +124,9 @@ public:
|
|||
entry->ReleaseReference();
|
||||
entry = next;
|
||||
}
|
||||
|
||||
while ((entry = fDeadEntries.RemoveHead()) != NULL)
|
||||
entry->ReleaseReference();
|
||||
}
|
||||
|
||||
status_t Init()
|
||||
|
@ -208,6 +211,12 @@ private:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
LocatableDirectory* parent = entry->Parent();
|
||||
if (parent != NULL)
|
||||
parent->RemoveEntry(entry);
|
||||
|
||||
delete entry;
|
||||
}
|
||||
|
||||
bool _LocateDirectory(LocatableDirectory* directory,
|
||||
|
|
Loading…
Reference in New Issue