rinigus / mapbox-gl-qml

Unofficial Mapbox GL Native bindings for Qt QML
GNU Lesser General Public License v3.0
38 stars 10 forks source link

Updating source layer many times (7000) could lead to crash #28

Closed rinigus closed 6 years ago

rinigus commented 6 years ago

As reported by @jdrescher2006 at TMO:

I have a problem in my app regarding the mapbox plugin. (https://github.com/jdrescher2006/Laufhelden)

After loading an autosave file, I would go through all recorded positions and then add each coordinate to an array. You can see the for statement in line 118 (https://github.com/jdrescher2006/Laufhelden/blob/17153d2ba4bab65c8a52cd90bff161ee3b0ac48f/qml/pages/RecordPage.qml#L118). Then in line 632, I would add each coordinate point to the map track.

And this line 632 is the problem. If the autosave is big enough e.g. >7000 coordinate points, the app will crash. Sometimes my phone even reboots then. Do you have an idea what could cause the problem?

Originally Posted by rinigus: And one more question: does it mean that you call updateSourceLine 7000 times (once per each point) during startup or is it all factored into one call?

That's correct, 7000 times during startup. And then somewhere in between it gets stuck and crashs.

While during workout it is called once every second. And it seems that this also leads to the crash after 2 hours or something.