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

Crash when transfering QGeoCustomMapObject

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: Location
    • Labels:
      None
    • Environment:
      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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes