Index: /trunk/BNC/src/bncfigure.cpp
===================================================================
--- /trunk/BNC/src/bncfigure.cpp	(revision 7639)
+++ /trunk/BNC/src/bncfigure.cpp	(revision 7640)
@@ -29,5 +29,5 @@
  * Class:      bncFigure
  *
- * Purpose:    
+ * Purpose:
  *
  * Author:     Perlt, Mervart
@@ -35,5 +35,5 @@
  * Created:    11-Nov-2009
  *
- * Changes:    
+ * Changes:
  *
  * -----------------------------------------------------------------------*/
@@ -41,5 +41,5 @@
 #include <iostream>
 
-#include "bncfigure.h" 
+#include "bncfigure.h"
 #include "bncsettings.h"
 
@@ -60,8 +60,13 @@
 // Destructor
 ////////////////////////////////////////////////////////////////////////////
-bncFigure::~bncFigure() { 
-}
-
-// 
+bncFigure::~bncFigure() {
+  QMapIterator<QByteArray, sumAndMean*> it(_bytes);
+  while (it.hasNext()) {
+    it.next();
+    delete it.value();
+  }
+}
+
+//
 ////////////////////////////////////////////////////////////////////////////
 void bncFigure::updateMountPoints() {
@@ -89,5 +94,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void bncFigure::slotNewData(const QByteArray staID, double nbyte) {
@@ -99,5 +104,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void bncFigure::slotNextAnimationFrame() {
@@ -129,5 +134,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void bncFigure::paintEvent(QPaintEvent *) {
@@ -187,5 +192,5 @@
       int yy = int(yLength * (it.value()->_mean / maxRateRounded));
       QColor color = QColor::fromRgb(_ran[0][anchor],_ran[1][anchor],_ran[2][anchor],150);
-      painter.fillRect(xx-13, int((yMax-yMin)*xLine)-yy, 9, yy, 
+      painter.fillRect(xx-13, int((yMax-yMin)*xLine)-yy, 9, yy,
                        QBrush(color,Qt::SolidPattern));
       painter.setPen(Qt::black);
Index: /trunk/BNC/src/bncmain.cpp
===================================================================
--- /trunk/BNC/src/bncmain.cpp	(revision 7639)
+++ /trunk/BNC/src/bncmain.cpp	(revision 7640)
@@ -379,4 +379,13 @@
   }
 
+  bncWindow*          bncWin = 0;
+  t_reqcEdit*         reqcEdit = 0;
+  t_reqcAnalyze*      reqcAnalyze = 0;
+  t_sp3Comp*          sp3Comp = 0;
+  bncEphUploadCaster* casterEph = 0;
+  bncCaster*          caster = 0;
+  bncRawFile*         rawFile =  0;
+  bncGetThread*       getThread = 0;
+
   // Interactive Mode - open the main window
   // ---------------------------------------
@@ -395,5 +404,5 @@
     app.setWindowIcon(QPixmap(":ntrip-logo.png"));
 
-    bncWindow* bncWin = new bncWindow();
+    bncWin = new bncWindow();
     BNC_CORE->setMainWindow(bncWin);
     bncWin->show();
@@ -403,5 +412,5 @@
   // -------------------
   else if (settings.value("PPP/dataSource").toString() == "RINEX Files") {
-    bncCaster* caster = new bncCaster();
+    caster = new bncCaster();
     BNC_CORE->setCaster(caster);
     BNC_CORE->setMode(t_bncCore::batchPostProcessing);
@@ -413,5 +422,5 @@
   else if (settings.value("reqcAction").toString() == "Edit/Concatenate") {
     BNC_CORE->setMode(t_bncCore::batchPostProcessing);
-    t_reqcEdit* reqcEdit = new t_reqcEdit(0);
+    reqcEdit = new t_reqcEdit(0);
     reqcEdit->start();
   }
@@ -421,5 +430,5 @@
   else if (settings.value("reqcAction").toString() == "Analyze") {
     BNC_CORE->setMode(t_bncCore::batchPostProcessing);
-    t_reqcAnalyze* reqcAnalyze = new t_reqcAnalyze(0);
+    reqcAnalyze = new t_reqcAnalyze(0);
     reqcAnalyze->start();
   }
@@ -429,5 +438,5 @@
   else if (!settings.value("sp3CompFile").toString().isEmpty()) {
     BNC_CORE->setMode(t_bncCore::batchPostProcessing);
-    t_sp3Comp* sp3Comp = new t_sp3Comp(0);
+    sp3Comp = new t_sp3Comp(0);
     sp3Comp->start();
   }
@@ -439,7 +448,7 @@
     signal(SIGINT, catch_signal);
 
-    bncEphUploadCaster* casterEph = new bncEphUploadCaster(); (void) casterEph;
-
-    bncCaster* caster = new bncCaster();
+    casterEph = new bncEphUploadCaster(); (void) casterEph;
+
+    caster = new bncCaster();
 
     BNC_CORE->setCaster(caster);
@@ -470,6 +479,6 @@
       BNC_CORE->startPPP();
 
-      bncRawFile*   rawFile   = new bncRawFile(rawFileName, "", bncRawFile::input);
-      bncGetThread* getThread = new bncGetThread(rawFile);
+      rawFile   = new bncRawFile(rawFileName, "", bncRawFile::input);
+      getThread = new bncGetThread(rawFile);
       caster->addGetThread(getThread, true);
     }
@@ -478,4 +487,17 @@
   // Start the application
   // ---------------------
-  return app.exec();
+  app.exec();
+  if (interactive) {
+    delete bncWin;
+  }
+  if (caster) {
+    delete caster;
+  }
+  if (casterEph) {
+    delete casterEph;
+  }
+  if (rawFile) {
+    delete rawFile;
+  }
+  return 0;
 }
Index: /trunk/BNC/src/bncwindow.cpp
===================================================================
--- /trunk/BNC/src/bncwindow.cpp	(revision 7639)
+++ /trunk/BNC/src/bncwindow.cpp	(revision 7640)
@@ -1398,4 +1398,105 @@
   delete _caster; BNC_CORE->setCaster(0);
   delete _casterEph;
+  delete _bncFigureLate;
+  delete _bncFigurePPP;
+  delete _actHelp;
+  delete _actAbout;
+  delete _actFlowchart;
+  delete _actFontSel;
+  delete _actSaveOpt;
+  delete _actQuit;
+  delete _actAddMountPoints;
+  delete _actDeleteMountPoints;
+  delete _actMapMountPoints;
+  delete _actStart;
+  delete _actStop;
+  delete _actwhatsthis;
+  delete _proxyHostLineEdit;
+  delete _proxyPortLineEdit;
+  delete _sslCaCertPathLineEdit;
+  delete _sslIgnoreErrorsCheckBox;
+  delete _logFileLineEdit;
+  delete _rawOutFileLineEdit;
+  delete _rnxAppendCheckBox;
+  delete _onTheFlyComboBox;
+  delete _autoStartCheckBox;
+  delete _rnxPathLineEdit;
+  delete _rnxIntrComboBox;
+  delete _rnxSamplSpinBox;
+  delete _rnxFileCheckBox;
+  delete _rnxSkelLineEdit;
+  delete _rnxScrpLineEdit;
+  delete _rnxV3CheckBox;
+  delete _rnxV3filenameCheckBox;
+  delete _rnxV2Priority;
+  delete _ephPathLineEdit;
+  delete _ephIntrComboBox;
+  delete _ephOutPortLineEdit;
+  delete _ephV3CheckBox;
+  delete _ephV3filenameCheckBox;
+  delete _corrPathLineEdit;
+  delete _corrIntrComboBox;
+  delete _corrPortLineEdit;
+  delete _outPortLineEdit;
+  delete _outWaitSpinBox;
+  delete _outSamplSpinBox;
+  delete _outFileLineEdit;
+  delete _outUPortLineEdit;
+  delete _serialMountPointLineEdit;
+  delete _serialPortNameLineEdit;
+  delete _serialBaudRateComboBox;
+  delete _serialFlowControlComboBox;
+  delete _serialDataBitsComboBox;
+  delete _serialParityComboBox;
+  delete _serialStopBitsComboBox;
+  delete _serialAutoNMEAComboBox;
+  delete _serialFileNMEALineEdit;
+  delete _serialHeightNMEALineEdit;
+  delete _serialManualNMEASamplingSpinBox;
+  delete _adviseObsRateComboBox;
+  delete _adviseFailSpinBox;
+  delete _adviseRecoSpinBox;
+  delete _adviseScriptLineEdit;
+  delete _miscMountLineEdit;
+  delete _miscPortLineEdit;
+  delete _miscIntrComboBox;
+  delete _miscScanRTCMCheckBox;
+  _mountPointsTable->setRowCount(0);
+  _mountPointsTable->deleteLater();
+  delete _log;
+  _cmbTable->setRowCount(0);
+  _cmbTable->deleteLater();
+  delete _cmbMaxresLineEdit;
+  delete _cmbUseGlonass;
+  delete _cmbSamplSpinBox;
+  delete _cmbMethodComboBox;
+  _uploadTable->setRowCount(0);
+  _uploadTable->deleteLater();
+  delete _uploadIntrComboBox;
+  delete _uploadAntexFile;
+  delete _uploadSamplRtcmEphCorrSpinBox;
+  delete _uploadSamplSp3SpinBox;
+  delete _uploadSamplClkRnxSpinBox;
+  delete _uploadEphHostLineEdit;
+  delete _uploadEphPortLineEdit;
+  delete _uploadEphPasswordLineEdit;
+  delete _uploadEphMountpointLineEdit;
+  delete _uploadEphSampleSpinBox;
+  delete _uploadEphBytesCounter;
+  delete _loggroup;
+  delete _reqcActionComboBox;
+  delete _reqcObsFileChooser;
+  delete _reqcNavFileChooser;
+  delete _reqcOutObsLineEdit;
+  delete _reqcOutNavLineEdit;
+  delete _reqcOutLogLineEdit;
+  delete _reqcPlotDirLineEdit;
+  delete _reqcSkyPlotSignals;
+  delete _reqcLogSummaryOnly;
+  delete _reqcEditOptionButton;
+  delete _sp3CompFileChooser;
+  delete _sp3CompExclude;
+  delete _sp3CompLogLineEdit;
+  //delete _canvas;
 }
 
@@ -2169,4 +2270,5 @@
 ////////////////////////////////////////////////////////////////////////////
 bncAboutDlg::~bncAboutDlg() {
+
 };
 
Index: /trunk/BNC/src/pppWidgets.cpp
===================================================================
--- /trunk/BNC/src/pppWidgets.cpp	(revision 7639)
+++ /trunk/BNC/src/pppWidgets.cpp	(revision 7640)
@@ -207,4 +207,50 @@
 //
 ////////////////////////////////////////////////////////////////////////////
+t_pppWidgets::~t_pppWidgets() {
+  delete _dataSource;
+  delete _rinexObs;
+  delete _rinexNav;
+  delete _corrMount;
+  delete _corrFile;
+  delete _crdFile;
+  delete _antexFile;
+  delete _logPath;
+  delete _nmeaPath;
+  delete _snxtroPath;
+  delete _snxtroSampl;
+  delete _snxtroIntr;
+  delete _v3filenames;
+  for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
+    _staTable->removeRow(iRow);
+  }
+  delete _staTable;
+  delete _lcGPS;
+  delete _lcGLONASS;
+  delete _lcGalileo;
+  delete _lcBDS;
+  delete _sigmaC1;
+  delete _sigmaL1;
+  delete _maxResC1;
+  delete _maxResL1;
+  delete _minObs;
+  delete _minEle;
+  delete _eleWgtCode;
+  delete _eleWgtPhase;
+  delete _seedingTime;
+  delete _corrWaitTime;
+  delete _addStaButton;
+  delete _delStaButton;
+  delete _plotCoordinates;
+  delete _mapWinButton;
+  delete _useGoogleMap;
+  delete _useOpenStreetMap;
+  delete _audioResponse;
+  delete _mapWinDotSize;
+  delete _mapWinDotColor;
+  delete _mapSpeedSlider;
+}
+
+//
+////////////////////////////////////////////////////////////////////////////
 void t_pppWidgets::readOptions() {
 
Index: /trunk/BNC/src/pppWidgets.h
===================================================================
--- /trunk/BNC/src/pppWidgets.h	(revision 7639)
+++ /trunk/BNC/src/pppWidgets.h	(revision 7640)
@@ -35,4 +35,5 @@
  public:
   t_pppWidgets();
+  ~t_pppWidgets();
   void saveOptions();
 
