Fix 2 Google Map SEGV

.. webBridge crash in QtWebKit for 4.8.4 (qt-bug 30403)

.. delete GoogleMap leaves webBridge orphaned which will
   crash if intervals are created or removed.

We need a proper fix for the webkit issue which we will get
when we migrate to Qt5.
This commit is contained in:
Mark Liversedge
2013-04-25 21:18:33 +01:00
parent 3d5ace45a0
commit 52e22555c7
2 changed files with 14 additions and 2 deletions

View File

@@ -64,6 +64,11 @@ GoogleMapControl::GoogleMapControl(MainWindow *mw) : GcChartWindow(mw), main(mw)
first = true;
}
GoogleMapControl::~GoogleMapControl()
{
delete webBridge;
}
void
GoogleMapControl::rideSelected()
{
@@ -437,6 +442,7 @@ GoogleMapControl::createMarkers()
laststoptime = rfp->secs;
}
//
// INTERVAL MARKERS
//
@@ -452,12 +458,17 @@ GoogleMapControl::createMarkers()
" var marker = new google.maps.Marker({ title: '%3', animation: google.maps.Animation.DROP, position: latlng });"
" marker.setMap(map);"
" markerList.push(marker);" // keep track of those suckers
#if 0
" google.maps.event.addListener(marker, 'click', function(event) { webBridge.toggleInterval(%4); });"
#endif
"}")
.arg(myRideItem->ride()->dataPoints()[offset]->lat,0,'g',GPS_COORD_TO_STRING)
.arg(myRideItem->ride()->dataPoints()[offset]->lon,0,'g',GPS_COORD_TO_STRING)
.arg(x.name)
.arg(interval);
#if 0
.arg(interval)
#endif
;
view->page()->mainFrame()->evaluateJavaScript(code);
interval++;
}
@@ -600,6 +611,7 @@ WebBridge::drawOverlays()
void
WebBridge::toggleInterval(int x)
{
return;
IntervalItem *current = dynamic_cast<IntervalItem *>(mainWindow->allIntervalItems()->child(x));
if (current) current->setSelected(!current->isSelected());
}