summaryrefslogtreecommitdiffabout
path: root/kabc/vcard/ContentLine.cpp
authorulf69 <ulf69>2004-08-19 23:29:05 (UTC)
committer ulf69 <ulf69>2004-08-19 23:29:05 (UTC)
commitd81fbb0a720ba6eb0fbfa1d1eb0748877237a27e (patch) (unidiff)
tree9b723a5c4f7da306036495e35d1863fbee646984 /kabc/vcard/ContentLine.cpp
parentd9b7a7296b031b3cf3e510a163367b9c4ab42d7a (diff)
downloadkdepimpi-d81fbb0a720ba6eb0fbfa1d1eb0748877237a27e.zip
kdepimpi-d81fbb0a720ba6eb0fbfa1d1eb0748877237a27e.tar.gz
kdepimpi-d81fbb0a720ba6eb0fbfa1d1eb0748877237a27e.tar.bz2
bugfix: memoryleak in vCards during loading of addressbooks
Diffstat (limited to 'kabc/vcard/ContentLine.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/vcard/ContentLine.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp
index 6fa1a8f..0fb5b5d 100644
--- a/kabc/vcard/ContentLine.cpp
+++ b/kabc/vcard/ContentLine.cpp
@@ -68,21 +68,38 @@ ContentLine::ContentLine()
68 :Entity(), 68 :Entity(),
69 value_(0) 69 value_(0)
70{ 70{
71 paramList_.setAutoDelete( TRUE );
71} 72}
72 73
73ContentLine::ContentLine(const ContentLine & x) 74ContentLine::ContentLine(const ContentLine & x)
74 :Entity(x), 75 :Entity(x),
75 group_ (x.group_), 76 group_ (x.group_),
76 name_ (x.name_), 77 name_ (x.name_),
77 paramList_(x.paramList_), 78 /*US paramList_(x.paramList_),*/
78 value_(x.value_->clone()) 79 value_(x.value_->clone()),
80 paramType_(x.paramType_),
81 valueType_(x.valueType_),
82 entityType_(x.entityType_)
79{ 83{
84 paramList_.setAutoDelete( TRUE );
85
86
87 ParamListIterator it(x.paramList_);
88 for (; it.current(); ++it)
89 {
90 Param *p = new Param;
91 p->setName( it.current()->name() );
92 p->setValue( it.current()->value() );
93 paramList_.append(p);
94 }
95
80} 96}
81 97
82ContentLine::ContentLine(const QCString & s) 98ContentLine::ContentLine(const QCString & s)
83 :Entity(s), 99 :Entity(s),
84 value_(0) 100 value_(0)
85{ 101{
102 paramList_.setAutoDelete( TRUE );
86} 103}
87 104
88 ContentLine & 105 ContentLine &
@@ -90,7 +107,15 @@ ContentLine::operator = (ContentLine & x)
90{ 107{
91 if (*this == x) return *this; 108 if (*this == x) return *this;
92 109
93 paramList_ = x.paramList(); 110 ParamListIterator it(x.paramList_);
111 for (; it.current(); ++it)
112 {
113 Param *p = new Param;
114 p->setName( it.current()->name() );
115 p->setValue( it.current()->value() );
116 paramList_.append(p);
117 }
118
94 value_ = x.value_->clone(); 119 value_ = x.value_->clone();
95 120
96 Entity::operator = (x); 121 Entity::operator = (x);