Skip to content

Commit

Permalink
Fix crash when concurrent rendering operations occur
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 1, 2017
1 parent 809d30f commit f354a85
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/core/qgspropertycollection.cpp
Expand Up @@ -96,6 +96,28 @@ QgsPropertyCollection::QgsPropertyCollection( const QString& name )
, mHasDynamicProperties( false )
{}

QgsPropertyCollection::QgsPropertyCollection( const QgsPropertyCollection& other )
: QgsAbstractPropertyCollection( other )
, mProperties( other.mProperties )
, mDirty( other.mDirty )
, mHasActiveProperties( other.mHasActiveProperties )
, mHasDynamicProperties( other.mHasDynamicProperties )
, mCount( other.mCount )
{
mProperties.detach();
}

QgsPropertyCollection&QgsPropertyCollection::operator=( const QgsPropertyCollection & other )
{
mProperties = other.mProperties;
mProperties.detach();
mDirty = other.mDirty;
mHasActiveProperties = other.mHasActiveProperties;
mHasDynamicProperties = other.mHasDynamicProperties;
mCount = other.mCount;
return *this;
}

int QgsPropertyCollection::count() const
{
if ( !mDirty )
Expand Down
7 changes: 7 additions & 0 deletions src/core/qgspropertycollection.h
Expand Up @@ -260,6 +260,13 @@ class CORE_EXPORT QgsPropertyCollection : public QgsAbstractPropertyCollection
*/
QgsPropertyCollection( const QString& name = QString() );

/**
* Copy constructor.
*/
QgsPropertyCollection( const QgsPropertyCollection& other );

QgsPropertyCollection& operator=( const QgsPropertyCollection& other );

/**
* Returns the number of properties contained within the collection.
*/
Expand Down

0 comments on commit f354a85

Please sign in to comment.