Skip to content

Commit

Permalink
fix qgis crash on startup (invalid pointer)
Browse files Browse the repository at this point in the history
  • Loading branch information
myarjunar authored and nyalldawson committed Sep 12, 2017
1 parent bea89b3 commit 92a1550
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/providers/ows/qgsowsdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,15 @@ void QgsOWSRootItem::newConnection()
static QStringList extensions = QStringList();
static QStringList wildcards = QStringList();

QGISEXTERN QList<QgsDataItemProvider *> dataItemProviders()
QGISEXTERN QList<QgsDataItemProvider *> *dataItemProviders()
{
return QList<QgsDataItemProvider *>()
QList<QgsDataItemProvider *> *providers = new QList<QgsDataItemProvider *>();

*providers
<< new QgsOwsDataItemProvider
<< new QgsGeoNodeDataItemProvider;

return providers;
}

QgsDataItem *QgsOwsDataItemProvider::createDataItem( const QString &path, QgsDataItem *parentItem )
Expand Down
9 changes: 6 additions & 3 deletions src/providers/wfs/qgswfsdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,11 @@ QGISEXTERN QgsDataItem *dataItem( QString path, QgsDataItem *parentItem )
return nullptr;
}

QGISEXTERN QList<QgsDataItemProvider *> dataItemProviders()
QGISEXTERN QList<QgsDataItemProvider *> *dataItemProviders()
{
return QList<QgsDataItemProvider *>()
<< new QgsWfsDataItemProvider;
QList<QgsDataItemProvider *> *providers = new QList<QgsDataItemProvider *>();

*providers << new QgsWfsDataItemProvider;

return providers;
}

0 comments on commit 92a1550

Please sign in to comment.