Thread: [SailfishOS] Mapbox GL Native QML plugin
View Single Post
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#59
Originally Posted by jdrescher View Post
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.

You know, I think the amount of calls of the updatesourceline function is limited. Maybe it helps to split the track points to multiple layers of track lines. I will do some more tests tomorrow.
I have added your case as an issue at https://github.com/rinigus/mapbox-gl-qml/issues/28

Its suggests memory leak somewhere and I'll look into it. Note that maybe you could refactor your startup calls into one. Namely, there are several threads involved in this widget - GUI thread and OpenGL threads - that have to communicate to transfer data from QML to Mapbox GL. As a result, all add/update/... are first accumulated in a stack by GUI thread and then played back through Mapbox GL functions when Qt gives allows OpenGL rendering to run. So, I wouldn't be surprised if these 7000 calls are waiting in the stack until you finish init of your QML code. From the design point of view, I would suggest to call with the full data if you have it already anyway.

As for a crash during workout, that's not too good either. Please don't split the data into several smaller layers, its better than I fix it on the widget side properly. At least give me a chance to work on it first before we start doing workarounds for bugs. So, with the workout part, maybe put deltaT for data saving for 3 seconds, or run faster, or just accept crashes for time being.

I will look into this issue this week. I am preparing new maps (generating tiles right now) for uploads and can work on Mapbox GL as well. But it may take few days to find the source for it and I would have to get it crashing on my device first as well.
 

The Following 4 Users Say Thank You to rinigus For This Useful Post: