rem: if (msgSender) delete msgSender; if (folderMgr) delete folderMgr; if (acctMgr) delete acctMgr; if (kbp) delete kbp;
add: app->getConfig()->sync();
context: static void cleanup(void){  app->getConfig()->sync();  trashFolder->close();  qInstallMsgHandler(oldMsgHandler);  if (msgSender) delete msgSender;  if (folderMgr) delete folderMgr;  if (acctMgr) delete acctMgr;  if (kbp) delete kbp;}