The FontStyles are already deleted when deconstructing the family list - the
styles hash table shouldn't try to delete them again. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14780 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -23,7 +23,7 @@ class HashTable {
|
||||
HashTable(int32 capacity = 100, float loadFactor = 0.75);
|
||||
~HashTable();
|
||||
|
||||
void MakeEmpty();
|
||||
void MakeEmpty(bool deleteValues = true);
|
||||
bool IsEmpty() const { return fCount == 0; }
|
||||
bool ContainsKey(Hashable& key) const { return _GetHashEntry(key) != NULL; }
|
||||
int32 CountItems() const { return fCount; }
|
||||
|
||||
@@ -88,6 +88,10 @@ FontManager::~FontManager()
|
||||
{
|
||||
FTC_Manager_Done(ftmanager);
|
||||
FT_Done_FreeType(gFreeTypeLibrary);
|
||||
|
||||
// we need to make sure the hash table doesn't delete the font styles;
|
||||
// that's already done by the lists
|
||||
fStyleHashTable.MakeEmpty(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,15 +45,19 @@ HashTable::~HashTable()
|
||||
|
||||
|
||||
void
|
||||
HashTable::MakeEmpty()
|
||||
HashTable::MakeEmpty(bool deleteValues)
|
||||
{
|
||||
if (fTable == NULL)
|
||||
return;
|
||||
|
||||
for (int32 index = fCapacity; --index >= 0;) {
|
||||
struct entry *entry, *next;
|
||||
|
||||
for (entry = fTable[index]; entry != NULL; entry = next) {
|
||||
next = entry->next;
|
||||
|
||||
delete entry->value;
|
||||
if (deleteValues)
|
||||
delete entry->value;
|
||||
delete entry;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user