What's is problem? "the inferior stopped because it recieved a signal from operating system"



  • I have 1 class (SmsParser)
    In main() function, I put some code:
    @SmsParser * smsParser = new SmsParser();
    QString smsParsed = smsParser->parseSMS("This is SMS parser.");
    @
    It work OK.
    //Next I put above code into a SLOT named callSMSParser in mainWindow.cpp
    //Next, I place a push button named btn_ParseSMS on MainWindow.ui
    //next:
    @QObject::connect(btn_ParseSMS, SIGNAL(clicked()), kqxsMainWindow, SLOT(callSMSParser()));@
    When I start debug the code above work fine, but when I clicked on btn_ParseSMS push button, this error happened:"the inferior stopped because it recieved a signal from operating system".
    At last, if i change type of varible smsParser (Do not use pointer):
    @SmsParser smsParser;
    QString smsParsed = smsParser.parseSMS("This is SMS parser.");@
    It work ok.
    I don't know why? and how to fix this?
    Help me!
    thanks a lot!


  • Moderators

    The message means that the operating system send a signal to the process, asking it to terminate. These signals are a asynchronous communication mechanism of the OS and not the signals you know from Qt. They get raised when the OS sees a reason (like out of memory conditions, etc.). You should investigate which signal was received and under which conditions that is raised.

    In this case you might try to increase the heap space available for your application.



  • Hi,
    Firstly I am assuming you are working on Mobile platform like symbian or Maemo.
    Well try making smsParser a member variable of the mainWindow class and allocate memory in the constructor of the mainWindow.

    @
    MainWindow::MainWindow()
    {
    smsParser = new SmsParser();
    }

    MainWindow::Slot()
    {
    QString smsParsed = smsParser->parseSMS("This is SMS parser.");
    }
    @

    Give it a shot.
    [edit: marked code / chetankjain]



  • Thanks you very much!
    I'll try it.



  • sriky27, enclosed the code with @ tag


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.