aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>2011-01-13 10:30:00 +0200
committerDenis Kenzior <denkenz@gmail.com>2011-01-13 10:02:29 -0600
commita26c2e8989b879d44361f487bb04ed586463e721 (patch)
tree69e4a8de2b4488bf17db6f610d3635312c8ef9c3
parenta4bcccb671362ee80ddcd938708b6fcdad0310bd (diff)
downloadphonesim-a26c2e8989b879d44361f487bb04ed586463e721.tar.gz
phonesim: fix for sigsegv fault
Fixes the issue in List count handling which might result in sigsegv during destruction. Also added additional check for start button handling.
-rw-r--r--src/control.cpp3
-rw-r--r--src/phonesim.cpp10
2 files changed, 9 insertions, 4 deletions
diff --git a/src/control.cpp b/src/control.cpp
index 2cbb91a..f2249cb 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -467,7 +467,8 @@ void Control::handleNewApp()
void ControlWidget::simAppStart()
{
- p->simAppStart( ui->cbSimApps->currentIndex() );
+ if ( ui->cbSimApps->currentIndex() >= 0 )
+ p->simAppStart( ui->cbSimApps->currentIndex() );
}
void ControlWidget::simAppAbort()
diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index 47425bc..8a9c50e 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -844,13 +844,17 @@ void SimRules::tryReadCommand()
void SimRules::destruct()
{
+ int count = simApps.count();
+
+ for ( int i = 0; i < count; i++ )
+ simApps.removeAt( 0 );
+
delete conformanceApp;
+ conformanceApp = NULL;
delete defaultToolkitApp;
+ defaultToolkitApp = NULL;
toolkitApp = NULL;
- for ( int i = 0; i < simApps.count(); i++ )
- simApps.removeAt( i );
-
if ( getMachine() )
getMachine()->handleNewApp();