Skip to content
Permalink
Browse files
fix crashes on exit (follows up r15751)
git-svn-id: http://svn.osgeo.org/qgis/trunk@15773 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 19, 2011
1 parent b6eab61 commit 2afbf95036a7d7b55a8dbec891468a35de42f32e
@@ -32,30 +32,43 @@ extern "C"
// if defined shows all information about transform to stdout
// #define COORDINATE_TRANSFORM_VERBOSE

QgsCoordinateTransform::QgsCoordinateTransform( ) : QObject(), mSourceCRS(), mDestCRS()
QgsCoordinateTransform::QgsCoordinateTransform()
: QObject()
, mInitialisedFlag( false )
, mSourceProjection( 0 )
, mDestinationProjection( 0 )
{
setFinder();
}

QgsCoordinateTransform::QgsCoordinateTransform( const QgsCoordinateReferenceSystem& source,
const QgsCoordinateReferenceSystem& dest )
QgsCoordinateTransform::QgsCoordinateTransform( const QgsCoordinateReferenceSystem& source, const QgsCoordinateReferenceSystem& dest )
: QObject()
, mInitialisedFlag( false )
, mSourceProjection( 0 )
, mDestinationProjection( 0 )
{
setFinder();

mSourceCRS = source;
mDestCRS = dest;
initialise();
}

QgsCoordinateTransform::QgsCoordinateTransform( long theSourceSrsId, long theDestSrsId )
: mSourceCRS( theSourceSrsId, QgsCoordinateReferenceSystem::InternalCrsId ),
mDestCRS( theDestSrsId, QgsCoordinateReferenceSystem::InternalCrsId )
: QObject()
, mInitialisedFlag( false )
, mSourceCRS( theSourceSrsId, QgsCoordinateReferenceSystem::InternalCrsId )
, mDestCRS( theDestSrsId, QgsCoordinateReferenceSystem::InternalCrsId )
, mSourceProjection( 0 )
, mDestinationProjection( 0 )
{
initialise();
}

QgsCoordinateTransform::QgsCoordinateTransform( QString theSourceCRS, QString theDestCRS ) : QObject()

QgsCoordinateTransform::QgsCoordinateTransform( QString theSourceCRS, QString theDestCRS )
: QObject()
, mInitialisedFlag( false )
, mSourceProjection( 0 )
, mDestinationProjection( 0 )
{
setFinder();
mSourceCRS.createFromWkt( theSourceCRS );
@@ -69,7 +82,11 @@ QgsCoordinateTransform::QgsCoordinateTransform( QString theSourceCRS, QString th

QgsCoordinateTransform::QgsCoordinateTransform( long theSourceSrid,
QString theDestWkt,
QgsCoordinateReferenceSystem::CrsType theSourceCRSType ): QObject()
QgsCoordinateReferenceSystem::CrsType theSourceCRSType )
: QObject()
, mInitialisedFlag( false )
, mSourceProjection( 0 )
, mDestinationProjection( 0 )
{
setFinder();

@@ -85,11 +102,11 @@ QgsCoordinateTransform::QgsCoordinateTransform( long theSourceSrid,
QgsCoordinateTransform::~QgsCoordinateTransform()
{
// free the proj objects
if ( mSourceProjection != 0 )
if ( mSourceProjection )
{
pj_free( mSourceProjection );
}
if ( mDestinationProjection != 0 )
if ( mDestinationProjection )
{
pj_free( mDestinationProjection );
}
@@ -106,7 +123,6 @@ void QgsCoordinateTransform::setDestCRS( const QgsCoordinateReferenceSystem& the
initialise();
}


void QgsCoordinateTransform::setDestCRSID( long theCRSID )
{
//!todo Add some logic here to determine if the srsid is a system or user one
@@ -118,11 +134,6 @@ void QgsCoordinateTransform::setDestCRSID( long theCRSID )
// And probably shouldn't be a void
void QgsCoordinateTransform::initialise()
{

mInitialisedFlag = false; //guilty until proven innocent...
mSourceProjection = NULL;
mDestinationProjection = NULL;

// XXX Warning - multiple return paths in this block!!
if ( !mSourceCRS.isValid() )
{
@@ -152,11 +163,11 @@ void QgsCoordinateTransform::initialise()
#endif

mInitialisedFlag = true;
if ( mDestinationProjection == NULL )
if ( !mDestinationProjection )
{
mInitialisedFlag = false;
}
if ( mSourceProjection == NULL )
if ( !mSourceProjection )
{
mInitialisedFlag = false;
}
@@ -298,7 +298,7 @@ class CORE_EXPORT QgsDataProvider : public QObject
* @param changed binary combination of changes
* @note added in 1.7
*/
void dataChanged( int change );
void dataChanged( int changed );

protected:
/**
@@ -58,11 +58,6 @@ QgsOfflineEditing::QgsOfflineEditing( QgsOfflineEditingProgressDialog* progressD

QgsOfflineEditing::~QgsOfflineEditing()
{
if ( mProgressDialog != NULL )
{
delete mProgressDialog;
}
disconnect( QgsMapLayerRegistry::instance(), SIGNAL( layerWasAdded( QgsMapLayer* ) ), this, SLOT( layerAdded( QgsMapLayer* ) ) );
}

/**
@@ -35,20 +35,17 @@ static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
static const QString sPluginIcon = ":/offline_editing/offline_editing_copy.png";

QgsOfflineEditingPlugin::QgsOfflineEditingPlugin( QgisInterface* theQgisInterface )
: QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface ),
mActionConvertProject( NULL ),
mActionSynchronize( NULL ),
mOfflineEditing( NULL )
: QgisPlugin( sName, sDescription, sPluginVersion, sPluginType )
, mQGisIface( theQgisInterface )
, mActionConvertProject( NULL )
, mActionSynchronize( NULL )
, mOfflineEditing( NULL )
{
}

QgsOfflineEditingPlugin::~QgsOfflineEditingPlugin()
{
if ( mOfflineEditing != NULL )
{
delete mOfflineEditing;
}
delete mOfflineEditing;
}

void QgsOfflineEditingPlugin::initGui()
@@ -59,18 +59,17 @@ static const QString icon_ = ":/icons/spatialquery.png";
* @parma mIface Pointer to the QGIS interface object
*/
QgsSpatialQueryPlugin::QgsSpatialQueryPlugin( QgisInterface* iface )
: QgisPlugin( name_, description_, version_, type_ ),
mIface( iface )
: QgisPlugin( name_, description_, version_, type_ )
, mDialog( 0 )
, mIface( iface )
, mSpatialQueryAction( 0 )
{
mDialog = NULL;
}

QgsSpatialQueryPlugin::~QgsSpatialQueryPlugin()
{
mIface = NULL;
delete mSpatialQueryAction;
delete mDialog;
}

/*
* Initialize the GUI interface for the plugin
*/

0 comments on commit 2afbf95

Please sign in to comment.