AW: [Bugfix] Fix unconsistent remove in PlacemarkLayout
Torsten Rahn
tackat at t-online.de
Sat Mar 25 18:42:21 GMT 2023
Hi Cui,
thanks for looking into this and submitting the patch - I will look into
it.
There is some extensive documentation for getting started with KDE
development. However as Marble can be compiled without KDE dependencies
there are lots of technical aspects that might not apply.
<https://community.kde.org/Infrastructure/GitLab#Submitting_a_merge_request>
<https://community.kde.org/Get_Involved/development#Submitting_your_first_patch>
The actual repo is at
https://invent.kde.org/education/marble
Best regards
Torsten
-----Original-Nachricht-----
Betreff: [Bugfix] Fix unconsistent remove in PlacemarkLayout
Datum: 2023-03-25T15:24:45+0100
Von: "?? WANG Cui" <iucgnaw at msn.com>
An: "Mailinglist, Marble-Devel" <marble-devel at kde.org>
Hi,
When I check Marble GitHub, but don’t find guidance which branch to do pull
request, therefore I submit bugfix patch here.
In PlacemarkLayout, when remove a placemark, m_paintOrder item is not
removed when m_visiblePlacemarks remove item. In extreme case ( i.e.
updateFeature() during plugin render() ), the m_paintOrder refer to deleted
Placemark then segmentation fault.
Patch is as attached.
diff --git a/src/lib/marble/PlacemarkLayout.cpp
b/src/lib/marble/PlacemarkLayout.cpp
index a66a1f46c..3c684b662 100644
--- a/src/lib/marble/PlacemarkLayout.cpp
+++ b/src/lib/marble/PlacemarkLayout.cpp
@@ -271,6 +271,7 @@ void PlacemarkLayout::removePlacemarks( const
QModelIndex& parent, int first, in
int zoomLevel = placemark->zoomLevel();
TileId key = TileId::fromCoordinates( coordinates, zoomLevel );
+ m_paintOrder.erase(std::remove(m_paintOrder.begin(),
m_paintOrder.end(), m_visiblePlacemarks[placemark]), m_paintOrder.end());
delete m_visiblePlacemarks[placemark];
m_visiblePlacemarks.remove(placemark);
m_placemarkCache[key].removeAll( placemark );
WANG Cui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20230325/51ff2375/attachment.htm>
More information about the Marble-devel
mailing list