Fix deallocation of process controllers when quitting the application

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/9/head
Michele Calgaro 1 year ago
parent c0effe456c
commit bbdc5984a2
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -134,23 +134,21 @@ void KStreamRipper::closeEvent( TQCloseEvent *e )
appConfig->writeEntry( "Id3Tag", m_id3Checkbox->isChecked());
//save the listview entrys
TQStringList nameList,urlList,descList;
TQListViewItemIterator iter( m_streamsListView );
while( iter.current() )
while( m_streamsListView->childCount() > 0)
{
ProcessListViewItem * ProcItem = (ProcessListViewItem*)iter.current();
if(ProcItem->getProcessController()->getAutomatic()) continue;
nameList.append( iter.current()->text( 0 ));
urlList.append( ProcItem->getProcessController()->getUrl() );
descList.append( ProcItem->getProcessController()->getDescription() );
if ( ProcItem->getProcessController()->getStatus() )
ProcessListViewItem * procItem = (ProcessListViewItem*)m_streamsListView->firstChild();
if (!procItem->getProcessController()->getAutomatic())
{
ProcItem->getProcessController()->stopRip();
nameList.append( procItem->text( 0 ));
urlList.append( procItem->getProcessController()->getUrl() );
descList.append( procItem->getProcessController()->getDescription() );
if ( procItem->getProcessController()->getStatus() )
{
procItem->getProcessController()->stopRip();
}
++iter;
}
delete procItem;
}
appConfig->writeEntry( "names", nameList );

@ -23,7 +23,7 @@
#include "processlistviewitem.h"
ProcessController::ProcessController(ProcessListViewItem * parent)
: TQObject((TQObject *)parent), myParent(parent), myStatus(false), myAutomatic(false), myProcess(new TQProcess(this))
: TQObject(parent), myParent(parent), myStatus(false), myAutomatic(false), myProcess(new TQProcess(this))
{
connect (myProcess, TQT_SIGNAL( readyReadStdout() ), (ProcessController *) this, TQT_SLOT( readStdout()) );
connect (myProcess, TQT_SIGNAL(processExited() ), (ProcessController *) this, TQT_SLOT( processExited()) );

Loading…
Cancel
Save