AnsweredAssumed Answered

Mapview crash on iOS

Question asked by james.a.pettitt on Mar 16, 2018
Latest reply on Apr 9, 2018 by james.a.pettitt

I am hoping to see if anyone knows anything about this issue and any potential workarounds.

 

The issue is that if a mapview with a map inside of it is created and later destroyed it crashes with the below message:

ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 0x0x174329f60. Receiver '' (of type 'QRTImpl::LocationDisplayImpl') was created in thread 0x0x17001d940", file kernel/qcoreapplication
.cpp, line 563 

This does not happen on Mac or Android. The usecase I have for this is creating a map in a component loaded up in a stackView. When I navigate away from that component the stackview kills the mapview which causes the crash. I created an Empty ArcGIS qml app for testing this issue in a more simple way by showing the map in a loader with a button that "unloads" it. See the bottom of the post for a simple example.

import QtQuick 2.6
import QtQuick.Controls 1.4
import Esri.ArcGISRuntime 100.2
ApplicationWindow {
    id: appWindow
    width: 800
    height: 600
    title: "IosMapTest"
    Rectangle {
        id: backgroundRect
        anchors.fill: parent
        color: "red"
    }
    Loader {
        id: mapLoader
        anchors.fill: parent
        // add a mapView component
        sourceComponent: MapView {
            anchors.fill: parent
            // set focus to enable keyboard navigation
            focus: true
            // add a map to the mapview
            Map {
                // add the BasemapTopographic basemap to the map
                BasemapTopographic {}
            }
        }
    }
    Button {
        anchors.bottom: parent.bottom
        anchors.right: parent.right
        text: "click here for crash"
        onClicked: mapLoader.sourceComponent = undefined
    }
}

Outcomes