@@ -70,7 +70,6 @@ DEALINGS IN THE SOFTWARE.
7070# include  " ./code/vpn_prov_ed/vpn_ed.h" 
7171# include  " ./code/trstring/tr_strings.h" 
7272# include  " ./code/shared/shared.h" 
73- # include  " ./code/gen_conf_ed/gen_conf_ed.h" 
7473
7574//   headers for system logging
7675# include  < stdio.h> 
@@ -162,7 +161,8 @@ ControlBox::ControlBox(const QCommandLineParser& parser, QWidget *parent)
162161  trayiconbackground = QColor ();
163162  trayicon = new  QSystemTrayIcon (this );
164163  f_connmanversion = 0.0 ;
165-   
164+   gened = NULL ;
165+   proc = NULL ;
166166  iconman = new  IconManager (this );
167167
168168  //  set a stylesheet on the tab widget - used to hide disabled tabs
@@ -740,7 +740,7 @@ void ControlBox::connectPressed()
740740    return ;
741741  }
742742
743- // Because of single selection mode list can only have 0 or 1 items in it.
743+    // Because of single selection mode list can only have 0 or 1 items in it.
744744  if  (qtw == ui.tableWidget_wifi ) pendingobjectpath = wifi_list.at (list.at (0 )->row ()).objpath .path ();
745745    else  if  (qtw == ui.tableWidget_vpn ) pendingobjectpath = vpn_list.at (list.at (0 )->row ()).objpath .path ();
746746      else  pendingobjectpath.clear ();
@@ -754,18 +754,16 @@ void ControlBox::connectPressed()
754754      QString cmd = args.first ();
755755      args.removeFirst ();
756756      if  (ui.checkBox_modifyservicefile ->isChecked ()) {
757- 	GEN_Editor*  gened = new  GEN_Editor (this );
757+ 	gened = new  GEN_Editor (this );
758758	gened->editInPlace (ui.comboBox_beforeconnectservicefile ->currentText (), cmd, args);
759759	connect  (gened, SIGNAL (finished (int )), this , SLOT (requestConnection ()));
760- // 	gened->deleteLater();
761760      } //  program does require a root helper 
762761      else  {
763- 	QProcess*  proc = new  QProcess (this );
764- 	proc->startDetached (cmd, args);
762+ 	proc = new  QProcess (this );
763+ 	proc->start (cmd, args);
765764	connect  (proc, SIGNAL (finished (int )), this , SLOT (requestConnection ()));
766- // 	proc->deleteLater();
767765      } //  program does not require root helper
768-     } //  if service is correct  
766+     } //  if selected  service matches the one to modify 
769767  } //  if there is a command to execute
770768
771769  //  else request the connection now
@@ -777,6 +775,11 @@ void ControlBox::connectPressed()
777775// 
778776//  Slot to actually request a connection via DBUS.  Called from the connectPressed() slot
779777void  ControlBox::requestConnection () {
778+   //  only way here is when a finished() signal fires, delete the object that did it
779+   if  (proc)  delete  proc;
780+   if  (gened) delete  gened;
781+ 
782+   //  data member
780783  QDBusInterface* iface_serv = NULL ;
781784
782785  iface_serv = new  QDBusInterface (DBUS_CON_SERVICE, pendingobjectpath, " net.connman.Service" QDBusConnection::systemBus (), this );
0 commit comments