我希望看看是否有人知道这个问题以及任何可能的解决方法。
我正在使用 ArcGIS Runtime SDK for Qt (100.2)。问题是,如果创建其中包含 map 的 map View 并随后将其销毁,则会崩溃并显示以下消息:
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
这不会发生在 Mac 或 Android 上。我的用例是在加载到 stackView 的组件中创建 map 。当我离开该组件时,stackview 会杀死导致崩溃的 mapview。我创建了一个 Empty ArcGIS qml 应用程序,用于以更简单的方式测试此问题,方法是在加载程序中显示带有“卸载” map 的按钮的 map 。有关简单示例,请参阅帖子底部。
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
}
}
最佳答案
这似乎是 ArcGIS Runtime 中的一个错误,因此我在我们的系统中记录了一个错误。我认为解决这个问题的唯一方法是不要在每次导航堆栈时创建/销毁页面。
关于ios - ArcGIS运行时SDK : Mapview crash on iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49386995/