commit 23a3412113a04fac0bdafffe9fc8a48c2a39e8ea Author: Juergen E. Fischer Date: Wed Jun 20 21:01:25 2012 +0200 fix #5809 diff --git a/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp b/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp index 7b0bbb6..5b9837a 100644 --- a/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp +++ b/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp @@ -139,6 +139,8 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri ) , mWktHasZM( false ) , mWktZMRegexp( "\\s+(?:z|m|zm)(?=\\s*\\()", Qt::CaseInsensitive ) , mWktCrdRegexp( "(\\-?\\d+(?:\\.\\d*)?\\s+\\-?\\d+(?:\\.\\d*)?)\\s[\\s\\d\\.\\-]+" ) + , mFile( 0 ) + , mStream( 0 ) , mSkipLines( 0 ) , mFirstDataLine( 0 ) , mShowInvalidLines( false ) @@ -212,6 +214,7 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri ) { QgsDebugMsg( "Data source " + dataSourceUri() + " could not be opened" ); delete mFile; + mFile = 0; return; } @@ -447,7 +450,8 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri ) QgsDelimitedTextProvider::~QgsDelimitedTextProvider() { - mFile->close(); + if ( mFile ) + mFile->close(); delete mFile; delete mStream; }