[Kde-finance-apps] [alkimia/5.0] libalkimia: Fix AlkValue::operator=(QString) w/ valueRef()

Cristian OneČ› onet.cristian at gmail.com
Tue Jun 21 06:58:56 UTC 2016


Pino, thanks for fixing this.

Regards,
Cristian

2016-06-20 23:25 GMT+03:00 Pino Toscano <pino at kde.org>:
> Git commit 2e6172a7d723d53ff62fc3eaf2ea7208db0fd0a7 by Pino Toscano.
> Committed on 20/06/2016 at 20:01.
> Pushed by pino into branch '5.0'.
>
> Fix AlkValue::operator=(QString) w/ valueRef()
>
> Do not set a new Private directly, since it will destroy the old one
> and invalidate the references to the internal m_val -- indeed, valgrind
> complains about that, and AlkValueTest::valueRef() fails on any
> architecture different than x86/x86_64.
>
> Instead, copy m_val from a new temporary AlkValue.
>
> M  +2    -1    libalkimia/alkvalue.cpp
>
> http://commits.kde.org/alkimia/2e6172a7d723d53ff62fc3eaf2ea7208db0fd0a7
>
> diff --git a/libalkimia/alkvalue.cpp b/libalkimia/alkvalue.cpp
> index 295ac06..9a52c1a 100644
> --- a/libalkimia/alkvalue.cpp
> +++ b/libalkimia/alkvalue.cpp
> @@ -462,7 +462,8 @@ const AlkValue & AlkValue::operator=(double right)
>
>  const AlkValue & AlkValue::operator=(const QString & right)
>  {
> -  d = AlkValue(right, QLatin1Char('.')).d;
> +  AlkValue other(right, QLatin1Char('.'));
> +  d->m_val = other.d->m_val;
>    return *this;
>  }
>
>


More information about the Kde-finance-apps mailing list