author | harlekin <harlekin> | 2002-04-07 13:08:50 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-04-07 13:08:50 (UTC) |
commit | 9aced2eebc244de560c1ca72786183dc93019b9d (patch) (side-by-side diff) | |
tree | a9061ef92e0510efb552088d464ac218583f142a | |
parent | f87f79ef356475764d8b9011c3f3b467d3015426 (diff) | |
download | opie-9aced2eebc244de560c1ca72786183dc93019b9d.zip opie-9aced2eebc244de560c1ca72786183dc93019b9d.tar.gz opie-9aced2eebc244de560c1ca72786183dc93019b9d.tar.bz2 |
fixed a mem leak, patch by Stefan Eilers
-rw-r--r-- | core/pim/today/today.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 51aba69..7cef035 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -74,8 +74,9 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) this, SLOT ( channelReceived(const QCString &, const QByteArray &)) ); #endif #endif + db = NULL; setOwnerField(); todo = new ToDoDB; getTodo(); draw(); @@ -208,9 +209,9 @@ void Today::init() { SHOW_NOTES = cfg.readNumEntry("shownotes",0); // should only later appointments be shown or all for the current day. ONLY_LATER = cfg.readNumEntry("onlylater",1); - db = new DateBookDB; + //db = new DateBookDB; } /* * The method for the configuration dialog. @@ -274,8 +275,13 @@ void Today::getDates() { if (AllDateBookEvents) delete AllDateBookEvents; AllDateBookEvents = new QWidget( ); QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); + if (db) { + delete db; + } + db = new DateBookDB; + QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); qBubbleSort(list); // printf("Get dates\n"); |