Don't call ref() in QByteArray::QByteArray()
The call is unnecessary; it does nothing since the shared_null ref count is negative. Change-Id: I0d0c35a554e4fc5b734a25dab06f04bee7a9ae24 Reviewed-on: http://codereview.qt-project.org/4637 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
parent
cfc39289ba
commit
eb1f41b8c1
@ -402,7 +402,7 @@ public:
|
||||
inline DataPtr &data_ptr() { return d; }
|
||||
};
|
||||
|
||||
inline QByteArray::QByteArray(): d(const_cast<Data *>(&shared_null.ba)) { d->ref.ref(); }
|
||||
inline QByteArray::QByteArray(): d(const_cast<Data *>(&shared_null.ba)) { }
|
||||
inline QByteArray::~QByteArray() { if (!d->ref.deref()) qFree(d); }
|
||||
inline int QByteArray::size() const
|
||||
{ return d->size; }
|
||||
|
Loading…
Reference in New Issue
Block a user