add: mainWin->writeConfig(FALSE); delete mainWin;
context: main(int argc, char *argv[]){  KMMainWin* mainWin;  init(argc, argv);  mainWin = new KMMainWin;  mainWin->show();  if (argc > 1 && argv[1][0]!='-')  {    KMComposeWin *win;    KMMessage* msg = new KMMessage;    msg->initHeader();    msg->setTo(argv[1]);    win = new KMComposeWin(msg);    win->show();  }      app->exec();  cleanup();}