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:
Axel Dörfler
2005-11-08 19:04:01 +00:00
parent 68e424c88b
commit 5e4d267b5e
3 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -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; }
+4
View File
@@ -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);
}
+6 -2
View File
@@ -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;
}
}