* [PATCH] phonesim: fix for sigsegv fault
@ 2011-01-13 8:30 Jeevaka Badrappan
2011-01-13 16:03 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Jeevaka Badrappan @ 2011-01-13 8:30 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]
Fixes the issue in List count handling which might result
in sigsegv during destruction. Also added additional check
for start button handling.
---
src/control.cpp | 3 ++-
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();
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-13 16:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 8:30 [PATCH] phonesim: fix for sigsegv fault Jeevaka Badrappan
2011-01-13 16:03 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.