Skip to content
Permalink
Browse files

Don't crash when QgsVectorLayer::setDataSource is called

  • Loading branch information
nyalldawson committed Jun 22, 2015
1 parent 436350a commit 9fc759308f891353ad4860dd768f1c9a677b334e
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/core/qgsvectorlayer.cpp
@@ -1371,15 +1371,12 @@ void QgsVectorLayer::setDataSource( QString dataSource, QString baseName, QStrin

bool QgsVectorLayer::setDataProvider( QString const & provider )
{
// XXX should I check for and possibly delete any pre-existing providers?
// XXX How often will that scenario occur?
Q_ASSERT( !mDataProvider );

mProviderKey = provider; // XXX is this necessary? Usually already set
// XXX when execution gets here.

//XXX - This was a dynamic cast but that kills the Windows
// version big-time with an abnormal termination error
delete mDataProvider;
mDataProvider =
( QgsVectorDataProvider* )( QgsProviderRegistry::instance()->provider( provider, mDataSource ) );

0 comments on commit 9fc7593

Please sign in to comment.
You can’t perform that action at this time.