Skip to content

Commit

Permalink
#823 crash when cancel in the middle of loading WFS
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed May 30, 2017
1 parent 88a2c4e commit 72498a9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1343,8 +1343,10 @@ void Project::CleanupPairsHLState()
bool Project::CommonProjectInit()
{
wxLogMessage("Project::CommonProjectInit()");
if (!InitFromOgrLayer())
if (!InitFromOgrLayer()) {
OGRDataAdapter::GetInstance().Close();
return false;
}

num_records = table_int->GetNumberRows();

Expand Down Expand Up @@ -1480,7 +1482,7 @@ bool Project::InitFromOgrLayer()
cont = prog_dlg.Update(layer_proxy->load_progress);
}
}
if (!cont) {
if (!cont || !prog_dlg.Update(-1)) { // or if cancel clicked
OGRDataAdapter::GetInstance().T_StopReadLayer(layer_proxy);
return false;
}
Expand Down

0 comments on commit 72498a9

Please sign in to comment.