Update of /cvsroot/sim-icq/sim/plugins/_core In directory sc8-pr-cvs1:/tmp/cvs-serv616/plugins/_core Modified Files: Tag: SHUTOFF cmenu.cpp cmenu.h commands.cpp core.cpp history.cpp maininfo.cpp msgedit.cpp msggen.cpp Log Message: Fix memory leaks Index: cmenu.cpp =================================================================== RCS file: /cvsroot/sim-icq/sim/plugins/_core/cmenu.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** cmenu.cpp 2 Aug 2003 19:21:24 -0000 1.2 --- cmenu.cpp 30 Aug 2003 23:19:24 -0000 1.2.2.1 *************** *** 17,20 **** --- 17,21 ---- #include "cmenu.h" + #include "commands.h" #include <qaccel.h> *************** *** 27,30 **** --- 28,32 ---- setCheckable(true); connect(this, SIGNAL(aboutToShow()), this, SLOT(showMenu())); + connect(this, SIGNAL(aboutToHide()), this, SLOT(hideMenu())); connect(this, SIGNAL(activated(int)), this, SLOT(menuActivated(int))); } *************** *** 145,148 **** --- 147,155 ---- processItem(s, bSeparator, bFirst, 0); } + } + + void CMenu::hideMenu() + { + clear(); } Index: cmenu.h =================================================================== RCS file: /cvsroot/sim-icq/sim/plugins/_core/cmenu.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** cmenu.h 2 Aug 2003 19:21:24 -0000 1.2 --- cmenu.h 30 Aug 2003 23:19:24 -0000 1.2.2.1 *************** *** 44,47 **** --- 44,48 ---- protected slots: void showMenu(); + void hideMenu(); void menuActivated(int); protected: Index: commands.cpp =================================================================== RCS file: /cvsroot/sim-icq/sim/plugins/_core/commands.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** commands.cpp 2 Aug 2003 19:21:24 -0000 1.2 --- commands.cpp 30 Aug 2003 23:19:24 -0000 1.2.2.1 *************** *** 41,47 **** MENU_MAP::iterator itm; for (itm = menues.begin(); itm != menues.end(); ++itm){ ! if ((*itm).second.menu) ! delete (*itm).second.menu; ! delete (*itm).second.def; } } --- 41,48 ---- MENU_MAP::iterator itm; for (itm = menues.begin(); itm != menues.end(); ++itm){ ! MenuDef &def = (*itm).second; ! if (def.menu) ! delete def.menu; ! delete def.def; } } Index: core.cpp =================================================================== RCS file: /cvsroot/sim-icq/sim/plugins/_core/core.cpp,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** core.cpp 28 Aug 2003 09:15:26 -0000 1.11 --- core.cpp 30 Aug 2003 23:19:24 -0000 1.11.2.1 *************** *** 1047,1051 **** --- 1047,1054 ---- delete m_icons; delete m_tmpl; + if (m_status) + delete m_status; + getContacts()->unregisterUserData(ar_data_id); getContacts()->unregisterUserData(sms_data_id); getContacts()->unregisterUserData(user_data_id); *************** *** 1231,1234 **** --- 1234,1240 ---- return (void*)ABORT_LOADING; return NULL; + case EventQuit: + destroy(); + return NULL; case EventHomeDir:{ string *cfg = (string*)(e->param()); *************** *** 1955,1959 **** if (p.isEmpty()) return NULL; ! p = TextEdit::unquoteString(p, 0, p.length()); QStringList l = QStringList::split("\n", p); QStringList::Iterator it; --- 1961,1965 ---- if (p.isEmpty()) return NULL; ! p = unquoteText(p); QStringList l = QStringList::split("\n", p); QStringList::Iterator it; *************** *** 2466,2470 **** while ((w = it.current()) != NULL){ ++it; ! if (w->inherits("Container")) forRemove.push_back(w); } --- 2472,2478 ---- while ((w = it.current()) != NULL){ ++it; ! if (w->inherits("Container") || ! w->inherits("HistoryWindow") || ! w->inherits("UserConfig")) forRemove.push_back(w); } *************** *** 2933,2937 **** } showPanel(); - } --- 2941,2944 ---- Index: history.cpp =================================================================== RCS file: /cvsroot/sim-icq/sim/plugins/_core/history.cpp,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** history.cpp 29 Aug 2003 01:23:07 -0000 1.3.2.1 --- history.cpp 30 Aug 2003 23:19:24 -0000 1.3.2.2 *************** *** 258,262 **** if (msg){ if (!m_filter.isEmpty()){ ! QString p = unquoteString(msg->presentation()).lower(); if (p.find(m_filter) < 0){ delete msg; --- 258,262 ---- if (msg){ if (!m_filter.isEmpty()){ ! QString p = unquoteText(msg->presentation()).lower(); if (p.find(m_filter) < 0){ delete msg; Index: maininfo.cpp =================================================================== RCS file: /cvsroot/sim-icq/sim/plugins/_core/maininfo.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** maininfo.cpp 2 Aug 2003 19:21:24 -0000 1.2 --- maininfo.cpp 30 Aug 2003 23:19:24 -0000 1.2.2.1 *************** *** 173,177 **** QString number; QString type; ! unsigned icon; QString proto; QString phone = getToken(phones, ';', false); --- 173,177 ---- QString number; QString type; ! unsigned icon = 0; QString proto; QString phone = getToken(phones, ';', false); *************** *** 180,184 **** number = getToken(phoneItem, ','); type = getToken(phoneItem, ','); ! icon = atol(getToken(phoneItem, ',').latin1()); QListViewItem *item = new QListViewItem(lstPhones); fillPhoneItem(item, number, type, icon, proto); --- 180,185 ---- number = getToken(phoneItem, ','); type = getToken(phoneItem, ','); ! if (!phoneItem.isEmpty()) ! icon = atol(getToken(phoneItem, ',').latin1()); QListViewItem *item = new QListViewItem(lstPhones); fillPhoneItem(item, number, type, icon, proto); Index: msgedit.cpp =================================================================== RCS file: /cvsroot/sim-icq/sim/plugins/_core/msgedit.cpp,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** msgedit.cpp 24 Aug 2003 23:24:36 -0000 1.9 --- msgedit.cpp 30 Aug 2003 23:19:24 -0000 1.9.2.1 *************** *** 1057,1061 **** { if (m_edit->textFormat() == QTextEdit::PlainText){ ! m_edit->insert(smiles()[id], false, true, true); return; } --- 1057,1061 ---- { if (m_edit->textFormat() == QTextEdit::PlainText){ ! m_edit->insert(smiles(id), false, true, true); return; } Index: msggen.cpp =================================================================== RCS file: /cvsroot/sim-icq/sim/plugins/_core/msggen.cpp,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** msggen.cpp 26 Aug 2003 20:06:34 -0000 1.4 --- msggen.cpp 30 Aug 2003 23:19:24 -0000 1.4.2.1 *************** *** 141,145 **** // we need to unqoute this text... QString text = m_edit->m_edit->text(); ! text = m_edit->m_edit->unquoteString(text,0,text.length()); bool bEnable = !text.isEmpty(); if (bEnable && m_edit->m_userWnd->m_list && m_edit->m_userWnd->m_list->selected.empty()) --- 141,145 ---- // we need to unqoute this text... QString text = m_edit->m_edit->text(); ! text = unquoteText(text); bool bEnable = !text.isEmpty(); if (bEnable && m_edit->m_userWnd->m_list && m_edit->m_userWnd->m_list->selected.empty()) |