This repository has been archived on 2019-08-07. You can view files and clone it, but cannot push or open issues or pull requests.
copr-dani-qgis/qgis-1.8.0-datasource-crash.patch

38 lines
1.3 KiB
Diff
Raw Normal View History

2012-07-18 22:54:22 +02:00
commit 23a3412113a04fac0bdafffe9fc8a48c2a39e8ea
Author: Juergen E. Fischer <jef@norbit.de>
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;
}