author | zecke <zecke> | 2003-05-07 16:01:45 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-05-07 16:01:45 (UTC) |
commit | ef9b40f99443fabed972d29ce47c2ccb29e77210 (patch) (side-by-side diff) | |
tree | 920e5b1c5807ca931e86425092d13429029ebe65 | |
parent | fd0b11fbfe36e87845df9282bb4ed090c7f51d35 (diff) | |
download | opie-ef9b40f99443fabed972d29ce47c2ccb29e77210.zip opie-ef9b40f99443fabed972d29ce47c2ccb29e77210.tar.gz opie-ef9b40f99443fabed972d29ce47c2ccb29e77210.tar.bz2 |
Prevent mem corruption
-rw-r--r-- | libopie/pim/oevent.cpp | 14 | ||||
-rw-r--r-- | libopie2/opiepim/oevent.cpp | 14 |
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 @@ -244,4 +244,9 @@ void OEvent::changeOrModify() { d2->location = data->location; - d2->manager = data->manager; - d2->recur = data->recur; + + if (data->manager ) + d2->manager = new OPimNotifyManager( *data->manager ); + + if ( data->recur ) + d2->recur = new ORecur( *data->recur ); + d2->note = data->note; @@ -253,6 +258,7 @@ void OEvent::changeOrModify() { d2->parent = data->parent; - d2->child = data->child; - if (d2->child ) + if ( data->child ) { + d2->child = new QArray<int>( *data->child ); d2->child->detach(); + } 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 @@ -244,4 +244,9 @@ void OEvent::changeOrModify() { d2->location = data->location; - d2->manager = data->manager; - d2->recur = data->recur; + + if (data->manager ) + d2->manager = new OPimNotifyManager( *data->manager ); + + if ( data->recur ) + d2->recur = new ORecur( *data->recur ); + d2->note = data->note; @@ -253,6 +258,7 @@ void OEvent::changeOrModify() { d2->parent = data->parent; - d2->child = data->child; - if (d2->child ) + if ( data->child ) { + d2->child = new QArray<int>( *data->child ); d2->child->detach(); + } |