Seg fault: WorkerScript.onMessage called after destructor



  • I've started seeing a segmentation fault after adding a WorkerScript to load my ListModel.

    @
    Rectangle
    {
    Component.onDestruction: console.log('onDestruction')

    ListModel { id: listModel; }
    
    WorkerScript {
        id: worker;
        source: "worker.js";
    }
    

    }

    WorkerScript.onMessage = function(msg)
    {
    console.log('onMessage++')
    if (msg.action == 'clear') {
    msg.model.clear();
    msg.model.sync();
    }
    console.log('onMessage--')
    }
    @

    I can see WorkerScript.onMessage is being called after Component.onDestruction.

    @
    onDestruction
    onMessage++
    Segmentation fault (core dumped)
    @

    I presume this can happen if my WorkerScript is doing something time consuming when the destructor is called too.

    I don't see any way for a WorkerScript to communicate back to the Component to say it's busy or a way for the Component to stop a WorkerScript.

    I've tried Qt 4.8.4 and Qt 4.8.5.

    Edit: Problem still exists in Qt 4.8.6.



  • Filed a bug:

    https://bugreports.qt-project.org/browse/QTBUG-38863

    Loader and WorkerScript don't work well together.


Log in to reply
 

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