Ensure QDBusConnectionPrivate pointer initialization
Change-Id: Id7ca5b412462b5d7a18d12f9a227fdf9ef7b2344 Coverity-Id: 180869 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
5b24f0a6bb
commit
e400b7e326
@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
\a parent.
|
\a parent.
|
||||||
*/
|
*/
|
||||||
QDBusServer::QDBusServer(const QString &address, QObject *parent)
|
QDBusServer::QDBusServer(const QString &address, QObject *parent)
|
||||||
: QObject(parent), d(0)
|
: QObject(parent), d(nullptr)
|
||||||
{
|
{
|
||||||
if (address.isEmpty())
|
if (address.isEmpty())
|
||||||
return;
|
return;
|
||||||
@ -83,7 +83,7 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent)
|
|||||||
localhost (elsewhere).
|
localhost (elsewhere).
|
||||||
*/
|
*/
|
||||||
QDBusServer::QDBusServer(QObject *parent)
|
QDBusServer::QDBusServer(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent), d(nullptr)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
// Use Unix sockets on Unix systems only
|
// Use Unix sockets on Unix systems only
|
||||||
@ -92,10 +92,8 @@ QDBusServer::QDBusServer(QObject *parent)
|
|||||||
const QString address = QStringLiteral("tcp:");
|
const QString address = QStringLiteral("tcp:");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!qdbus_loadLibDBus()) {
|
if (!qdbus_loadLibDBus())
|
||||||
d = 0;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
QDBusConnectionManager *instance = QDBusConnectionManager::instance();
|
QDBusConnectionManager *instance = QDBusConnectionManager::instance();
|
||||||
if (!instance)
|
if (!instance)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user