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

MapCircle leaks memory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 1.1.2
    • Location
    • None
    • Nokia N8

    Description

      Adding and removing dynamically created MapCircle objects to a Map does not free all allocated memory. Around 8 kB per MapCircle is not freed.

      From the attached example:
      ...
      function createIcon(lat,lon)
      {
      var icon = Qt.createQmlObject('import QtQuick 1.1; import QtMobility.location 1.2; ' +
      'MapCircle{ radius: 100; color: "'+ mainPage.iconColor + '"; ' +
      'center: Coordinate

      {latitude: ' + lat + '; longitude: ' + lon + '}

      ' + ' } ',
      mainPage);
      if (icon !== null)

      { map.addMapObject(icon); MapHelper.mapObjects.push(icon); }

      }
      function updateMap()
      {
      clearMap();
      for (var x= -10; x<10; x++ )
      for (var y= -5; y<5; y++ )

      { var lat = 52.45705 + x * 0.01; var lon = 13.41173 + y * 0.01; createIcon(lat,lon); }

      }
      function clearMap()
      {
      while ( MapHelper.mapObjects.length > 0 )

      { var mapObj = MapHelper.mapObjects.pop(); map.removeMapObject(mapObj); mapObj.destroy(); }

      }
      ...

      Attachments

        1. MainPage.qml
          2 kB
        2. mapmemorytest.zip
          149 kB

        Activity

          People

            satu.m.makela satu makela
            ebragge Eero Bragge
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: