diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-01-28 22:38:57 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-01-28 22:38:57 +0100 |
commit | 714f44f6412ecf4cfd62abd9133210f0bf937e75 (patch) | |
tree | 0ff4a9d34c730a326ab9a473afe0f91c67c08193 /src/css.hh | |
parent | 8ec2a45a3c8baf45fa75857d3587b21bcf5de78f (diff) |
make sure strings from CSS parser are freed
Diffstat (limited to 'src/css.hh')
-rw-r--r-- | src/css.hh | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -52,7 +52,7 @@ class CssProperty { public: typedef union { int intVal; - const char *strVal; + char *strVal; } Value; typedef enum { @@ -167,19 +167,24 @@ class CssProperty { * \brief A list of CssProperty objects. */ class CssPropertyList : public lout::misc::SimpleVector <CssProperty> { - int refCount; + int refCount; + bool ownerOfStrings; public: - CssPropertyList() : lout::misc::SimpleVector <CssProperty> (1) { + CssPropertyList(bool ownerOfStrings = false) : + lout::misc::SimpleVector <CssProperty> (1) { refCount = 0; + this->ownerOfStrings = ownerOfStrings; }; CssPropertyList(const CssPropertyList &p) : lout::misc::SimpleVector <CssProperty> (p) { refCount = 0; + ownerOfStrings = false; }; + ~CssPropertyList (); void set (CssProperty::Name name, CssProperty::Value value); - void set (CssProperty::Name name, const char *value) { + void set (CssProperty::Name name, char *value) { CssProperty::Value v; v.strVal = value; set (name, v); |