summaryrefslogtreecommitdiff
authorzecke <zecke>2003-05-07 16:01:45 (UTC)
committer zecke <zecke>2003-05-07 16:01:45 (UTC)
commitef9b40f99443fabed972d29ce47c2ccb29e77210 (patch) (unidiff)
tree920e5b1c5807ca931e86425092d13429029ebe65
parentfd0b11fbfe36e87845df9282bb4ed090c7f51d35 (diff)
downloadopie-ef9b40f99443fabed972d29ce47c2ccb29e77210.zip
opie-ef9b40f99443fabed972d29ce47c2ccb29e77210.tar.gz
opie-ef9b40f99443fabed972d29ce47c2ccb29e77210.tar.bz2
Prevent mem corruption
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/oevent.cpp14
-rw-r--r--libopie2/opiepim/oevent.cpp14
2 files changed, 20 insertions, 8 deletions
diff --git a/libopie/pim/oevent.cpp b/libopie/pim/oevent.cpp
index 56ea10d..3ba8a52 100644
--- a/libopie/pim/oevent.cpp
+++ b/libopie/pim/oevent.cpp
@@ -241,21 +241,27 @@ void OEvent::changeOrModify() {
241 data->deref(); 241 data->deref();
242 Data* d2 = new Data; 242 Data* d2 = new Data;
243 d2->description = data->description; 243 d2->description = data->description;
244 d2->location = data->location; 244 d2->location = data->location;
245 d2->manager = data->manager; 245
246 d2->recur = data->recur; 246 if (data->manager )
247 d2->manager = new OPimNotifyManager( *data->manager );
248
249 if ( data->recur )
250 d2->recur = new ORecur( *data->recur );
251
247 d2->note = data->note; 252 d2->note = data->note;
248 d2->created = data->created; 253 d2->created = data->created;
249 d2->start = data->start; 254 d2->start = data->start;
250 d2->end = data->end; 255 d2->end = data->end;
251 d2->isAllDay = data->isAllDay; 256 d2->isAllDay = data->isAllDay;
252 d2->timezone = data->timezone; 257 d2->timezone = data->timezone;
253 d2->parent = data->parent; 258 d2->parent = data->parent;
254 d2->child = data->child;
255 259
256 if (d2->child ) 260 if ( data->child ) {
261 d2->child = new QArray<int>( *data->child );
257 d2->child->detach(); 262 d2->child->detach();
263 }
258 264
259 data = d2; 265 data = d2;
260 } 266 }
261} 267}
diff --git a/libopie2/opiepim/oevent.cpp b/libopie2/opiepim/oevent.cpp
index 56ea10d..3ba8a52 100644
--- a/libopie2/opiepim/oevent.cpp
+++ b/libopie2/opiepim/oevent.cpp
@@ -241,21 +241,27 @@ void OEvent::changeOrModify() {
241 data->deref(); 241 data->deref();
242 Data* d2 = new Data; 242 Data* d2 = new Data;
243 d2->description = data->description; 243 d2->description = data->description;
244 d2->location = data->location; 244 d2->location = data->location;
245 d2->manager = data->manager; 245
246 d2->recur = data->recur; 246 if (data->manager )
247 d2->manager = new OPimNotifyManager( *data->manager );
248
249 if ( data->recur )
250 d2->recur = new ORecur( *data->recur );
251
247 d2->note = data->note; 252 d2->note = data->note;
248 d2->created = data->created; 253 d2->created = data->created;
249 d2->start = data->start; 254 d2->start = data->start;
250 d2->end = data->end; 255 d2->end = data->end;
251 d2->isAllDay = data->isAllDay; 256 d2->isAllDay = data->isAllDay;
252 d2->timezone = data->timezone; 257 d2->timezone = data->timezone;
253 d2->parent = data->parent; 258 d2->parent = data->parent;
254 d2->child = data->child;
255 259
256 if (d2->child ) 260 if ( data->child ) {
261 d2->child = new QArray<int>( *data->child );
257 d2->child->detach(); 262 d2->child->detach();
263 }
258 264
259 data = d2; 265 data = d2;
260 } 266 }
261} 267}