Fix compilation of QContiguousCache::operator=
freeData() takes a Data*, not a QContiguousCacheData*. Task-number: QTBUG-45783 Change-Id: I96d7ac38dac24b418138ffff13d7fdf09b1d6b07 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
parent
9a1283f8d3
commit
9269dcc8ed
@ -291,7 +291,7 @@ QContiguousCache<T> &QContiguousCache<T>::operator=(const QContiguousCache<T> &o
|
|||||||
{
|
{
|
||||||
other.d->ref.ref();
|
other.d->ref.ref();
|
||||||
if (!d->ref.deref())
|
if (!d->ref.deref())
|
||||||
freeData(d);
|
freeData(p);
|
||||||
d = other.d;
|
d = other.d;
|
||||||
if (!d->sharable)
|
if (!d->sharable)
|
||||||
detach_helper();
|
detach_helper();
|
||||||
|
@ -43,6 +43,8 @@ class tst_QContiguousCache : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private slots:
|
private slots:
|
||||||
|
void assignment();
|
||||||
|
|
||||||
void empty();
|
void empty();
|
||||||
void swap();
|
void swap();
|
||||||
|
|
||||||
@ -64,6 +66,16 @@ private slots:
|
|||||||
|
|
||||||
QTEST_MAIN(tst_QContiguousCache)
|
QTEST_MAIN(tst_QContiguousCache)
|
||||||
|
|
||||||
|
void tst_QContiguousCache::assignment()
|
||||||
|
{
|
||||||
|
// compile-only test: QTBUG-45783
|
||||||
|
QContiguousCache<int> cc1, cc2;
|
||||||
|
// copy:
|
||||||
|
cc1 = cc2;
|
||||||
|
// move:
|
||||||
|
cc1 = qMove(cc2);
|
||||||
|
}
|
||||||
|
|
||||||
void tst_QContiguousCache::empty()
|
void tst_QContiguousCache::empty()
|
||||||
{
|
{
|
||||||
QContiguousCache<int> c(10);
|
QContiguousCache<int> c(10);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user