diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-11-21 10:59:58 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-11-21 11:10:29 +0000 |
| commit | 41b54024714071fd97dbadd4a900017544620fae (patch) | |
| tree | bff0a0690426c0cc384afedbb2c7972cbfb8e55d /src/style-internal.h | |
| parent | fix Glib::Regex::match stack-use-after-scope (diff) | |
| download | inkscape-41b54024714071fd97dbadd4a900017544620fae.tar.gz inkscape-41b54024714071fd97dbadd4a900017544620fae.zip | |
fix #521 SPIString copy constructor
Diffstat (limited to 'src/style-internal.h')
| -rw-r--r-- | src/style-internal.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/style-internal.h b/src/style-internal.h index f395e23d3..bf1eb6d1b 100644 --- a/src/style-internal.h +++ b/src/style-internal.h @@ -614,6 +614,8 @@ public: : SPIBase(inherits) {} + SPIString(const SPIString &rhs) { *this = rhs; } + ~SPIString() override { g_free(_value); } @@ -625,6 +627,9 @@ public: void merge( const SPIBase* const parent ) override; SPIString& operator=(const SPIString& rhs) { + if (this == &rhs) { + return *this; + } SPIBase::operator=(rhs); g_free(_value); _value = g_strdup(rhs._value); @@ -838,6 +843,8 @@ public: this->clear(); } + SPIPaintOrder(const SPIPaintOrder &rhs) { *this = rhs; } + ~SPIPaintOrder() override { g_free( value ); } @@ -857,6 +864,9 @@ public: void merge( const SPIBase* const parent ) override; SPIPaintOrder& operator=(const SPIPaintOrder& rhs) { + if (this == &rhs) { + return *this; + } SPIBase::operator=(rhs); for( unsigned i = 0; i < PAINT_ORDER_LAYERS; ++i ) { layer[i] = rhs.layer[i]; |
