Merge "QSqlError: protect against self-assignment"
commit
48ce0bed62
|
|
@ -151,9 +151,13 @@ QSqlError::QSqlError(const QSqlError& other)
|
|||
|
||||
QSqlError& QSqlError::operator=(const QSqlError& other)
|
||||
{
|
||||
if (d)
|
||||
if (&other == this)
|
||||
return *this;
|
||||
if (d && other.d)
|
||||
*d = *other.d;
|
||||
else
|
||||
else if (d)
|
||||
*d = QSqlErrorPrivate();
|
||||
else if (other.d)
|
||||
d = new QSqlErrorPrivate(*other.d);
|
||||
return *this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#define _CRT_SECURE_NO_WARNINGS 1
|
||||
|
||||
#include <QTest>
|
||||
#include <QScopedValueRollback>
|
||||
#include <qplatformdefs.h>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#define _CRT_SECURE_NO_WARNINGS 1
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QTest>
|
||||
#include <QtCore/private/qipaddress_p.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue