summaryrefslogtreecommitdiff
path: root/src/css.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-01-29 16:25:30 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-01-29 16:25:30 +0100
commit43ffe310792e3bd73be73631c8619b4e3cf5db22 (patch)
tree29ca90bf2300420b5c63315397a8312e854c3142 /src/css.cc
parentcf67233a08169d16537640b43009122b788c1cf8 (diff)
free font names when replacing them
Diffstat (limited to 'src/css.cc')
-rw-r--r--src/css.cc19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/css.cc b/src/css.cc
index 30c5bc55..a486e834 100644
--- a/src/css.cc
+++ b/src/css.cc
@@ -25,25 +25,16 @@ void CssProperty::print () {
}
CssPropertyList::~CssPropertyList () {
- if (ownerOfStrings) {
- for (int i = 0; i < size (); i++) {
- CssProperty *p = getRef (i);
-
- switch (p->name) {
- case CssProperty::CSS_PROPERTY_CONTENT:
- case CssProperty::CSS_PROPERTY_FONT_FAMILY:
- dFree (p->value.strVal);
- break;
- default:
- break;
- }
- }
- }
+ if (ownerOfStrings)
+ for (int i = 0; i < size (); i++)
+ getRef (i)->free ();
}
void CssPropertyList::set (CssProperty::Name name, CssProperty::Value value) {
for (int i = 0; i < size (); i++)
if (getRef (i)->name == name) {
+ if (ownerOfStrings)
+ getRef (i)->free ();
getRef (i)->value = value;
return;
}