Hi,
my Felgo App crashes every time I use PhysicsWorld+BoxCollider and then navigate back from the NavigationStack. This behaviour only appears when I use those two components combined (PhysicsWorld and BoxCollider). My guess is that the deconstruction of entities is causing troubles (see StackTrace below). It crashes in the LiveDemo on my computer and on my phone (iOS) as well.
This is a minimal version of the code that crashes:
import Felgo 3.0
import QtQuick 2.0
App {
NavigationStack {
Page {
id: main
SimpleButton {
text: "next scene"
onClicked: main.navigationStack.push(component)
}
}
}
Component {
id: component
Page {
GameWindowItem {
activeScene: subScene
EntityManager {
id: entityManager
entityContainer: subScene
}
Scene {
id: subScene
PhysicsWorld {
gravity: Qt.point(0, 25)
}
EntityBase {
id: player
entityType: "player"
width: 25
height: 25
Rectangle {
anchors.fill: parent
color: "blue"
}
BoxCollider {
id: playerCollider
anchors.fill: parent
}
}
}
}
}
}
}
An excerpt from the crash report:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 net.vplay.apps.QMLLive 0x000000010b4cbc4a Box2DBody::~Box2DBody() + 42
1 net.vplay.apps.QMLLive 0x000000010b4c533f QQmlPrivate::QQmlElement<Box2DBody>::~QQmlElement() + 47
2 org.qt-project.QtCore 0x000000010dd980e0 QObjectPrivate::deleteChildren() + 224
3 org.qt-project.QtCore 0x000000010dd97ec4 QObject::~QObject() + 1700
4 org.qt-project.QtQuick 0x000000010bf32647 QQuickItem::~QQuickItem() + 871
I am using MacOS, QtCreator 4.10.2, Felgo 3.3.0.
What can I do to avoid this problem?
Thanks for your help!
Sylvia