Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-1908

Crash when transfering QGeoCustomMapObject

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 1.2.0
    • Location
    • None
    • Win7 64, MinGW, QtDesktop 4.7.4

    Description

      There is a seg fault when transferring a QGeoCustomMapObject subclass from one GeoMap to another one, using removeMapObject and addMapObject.

      For other map objects (QGeoMapPolylineObject, QGeoMapCircleObject, ...), the associated QGraphicsItem are contained in the QGeoTiledMapObjectInfo class and are created when the object is added to a GeoMap, and also deleted when removed from a GeoMap, when the info object is destroyed.

      However, for Custom map objects, the QGeoTiledMapCustomObjectInfo class does NOT create QGraphicsItem, it only copies the pointer from the QGeoMapCustomObject class.

      Thus, the problem is that the first time a custom object is removed from a GeoMap, its QGraphicsItem gets deleted (in the destructor of QGeoTiledMapObjectInfo), and it crashes if we use the QGeoCustomMapObject again.

      The solution I guess is to un-comment the QGeoTiledMapCustomObjectInfo destructor which sets the graphicsItem to NULL, preventing the QGeoTiledMapObjectInfo destructor from deleting it: //custom->setGraphicsItem(0);
      Why is this line commented out ?
      The graphicsItem could be deleted when the QGeoCustomMapObject is deleted ?

      Attachments

        Activity

          People

            hagaj Hanna Gaj
            habersaa Alexandre Habersaat
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: