Skip to content
Permalink
Browse files
2010-07-21 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
        Reviewed by Laszlo Gombos.

        [QT] Leak and few more fixes to qt port of geolocation
        https://bugs.webkit.org/show_bug.cgi?id=42753

        Fixes memory leak and default values set to attributes.

        Memory leak fix no new test case added.

        * platform/qt/GeolocationServiceQt.cpp: Added.
        (WebCore::GeolocationServiceQt::~GeolocationServiceQt):
        (WebCore::GeolocationServiceQt::positionUpdated):

Canonical link: https://commits.webkit.org/54656@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@63819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Jul 21, 2010
1 parent 604ed36 commit 86dbf67cfa6ad907fc24518fdb5b418a5d4610a7
Showing with 21 additions and 6 deletions.
  1. +15 −0 WebCore/ChangeLog
  2. +6 −6 WebCore/platform/qt/GeolocationServiceQt.cpp
@@ -1,3 +1,18 @@
2010-07-21 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>

Reviewed by Laszlo Gombos.

[QT] Leak and few more fixes to qt port of geolocation
https://bugs.webkit.org/show_bug.cgi?id=42753

Fixes memory leak and default values set to attributes.

Memory leak fix no new test case added.

* platform/qt/GeolocationServiceQt.cpp: Added.
(WebCore::GeolocationServiceQt::~GeolocationServiceQt):
(WebCore::GeolocationServiceQt::positionUpdated):

2010-07-21 Kristian Amlie <kristian.amlie@nokia.com>

Reviewed by Kenneth Rohde Christiansen.
@@ -55,6 +55,7 @@ GeolocationServiceQt::GeolocationServiceQt(GeolocationServiceClient* client)

GeolocationServiceQt::~GeolocationServiceQt()
{
delete m_location;
}

void GeolocationServiceQt::positionUpdated(const QGeoPositionInfo &geoPosition)
@@ -65,20 +66,19 @@ void GeolocationServiceQt::positionUpdated(const QGeoPositionInfo &geoPosition)
QGeoCoordinate coord = geoPosition.coordinate();
double latitude = coord.latitude();
double longitude = coord.longitude();
bool providesAltitude = true;
bool providesAltitude = (geoPosition.coordinate().type() == QGeoCoordinate::Coordinate3D);
double altitude = coord.altitude();

double accuracy = geoPosition.hasAttribute(QGeoPositionInfo::HorizontalAccuracy) ?
geoPosition.attribute(QGeoPositionInfo::HorizontalAccuracy) : 0.0;
double accuracy = geoPosition.attribute(QGeoPositionInfo::HorizontalAccuracy);

bool providesAltitudeAccuracy = geoPosition.hasAttribute(QGeoPositionInfo::VerticalAccuracy);
double altitudeAccuracy = providesAltitudeAccuracy ? geoPosition.attribute(QGeoPositionInfo::VerticalAccuracy) : 0.0;
double altitudeAccuracy = geoPosition.attribute(QGeoPositionInfo::VerticalAccuracy);

bool providesHeading = geoPosition.hasAttribute(QGeoPositionInfo::Direction);
double heading = providesHeading ? geoPosition.attribute(QGeoPositionInfo::Direction) : 0.0;
double heading = geoPosition.attribute(QGeoPositionInfo::Direction);

bool providesSpeed = geoPosition.hasAttribute(QGeoPositionInfo::GroundSpeed);
double speed = providesSpeed ? geoPosition.attribute(QGeoPositionInfo::GroundSpeed) : 0.0;
double speed = geoPosition.attribute(QGeoPositionInfo::GroundSpeed);

RefPtr<Coordinates> coordinates = Coordinates::create(latitude, longitude, providesAltitude, altitude,
accuracy, providesAltitudeAccuracy, altitudeAccuracy,

0 comments on commit 86dbf67

Please sign in to comment.