forked from organicmaps/organicmaps
Fixed restore connect to gps when drape is destroyed and then created
This commit is contained in:
parent
8ced79c005
commit
b562abdba2
1 changed files with 2 additions and 7 deletions
|
@ -1305,7 +1305,6 @@ void Framework::CreateDrapeEngine(ref_ptr<dp::OGLContextFactory> contextFactory,
|
|||
|
||||
if (m_connectToGpsTrack)
|
||||
{
|
||||
m_connectToGpsTrack = false;
|
||||
GpsTracker::Instance().Connect(bind(&Framework::OnUpdateGpsTrackPointsCallback, this, _1, _2));
|
||||
}
|
||||
}
|
||||
|
@ -1318,22 +1317,18 @@ ref_ptr<df::DrapeEngine> Framework::GetDrapeEngine()
|
|||
void Framework::DestroyDrapeEngine()
|
||||
{
|
||||
GpsTracker::Instance().Disconnect();
|
||||
|
||||
m_drapeEngine.reset();
|
||||
}
|
||||
|
||||
void Framework::ConnectToGpsTracker()
|
||||
{
|
||||
m_connectToGpsTrack = true;
|
||||
if (m_drapeEngine)
|
||||
{
|
||||
m_connectToGpsTrack = false;
|
||||
m_drapeEngine->ClearGpsTrackPoints();
|
||||
GpsTracker::Instance().Connect(bind(&Framework::OnUpdateGpsTrackPointsCallback, this, _1, _2));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Postspone connect to tracker until is being constructed
|
||||
m_connectToGpsTrack = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Framework::DisconnectFromGpsTracker()
|
||||
|
|
Loading…
Add table
Reference in a new issue