diff options
author | Jeevaka Badrappan <jeevaka.badrappan@elektrobit.com> | 2011-01-13 10:30:00 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-01-13 10:02:29 -0600 |
commit | a26c2e8989b879d44361f487bb04ed586463e721 (patch) | |
tree | 69e4a8de2b4488bf17db6f610d3635312c8ef9c3 | |
parent | a4bcccb671362ee80ddcd938708b6fcdad0310bd (diff) | |
download | phonesim-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.cpp | 3 | ||||
-rw-r--r-- | src/phonesim.cpp | 10 |
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(); |