diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-05-04 20:06:36 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-05-04 20:20:42 (GMT) |
commit | c79246683a5033f605acd59d1c37d68381383a06 (patch) | |
tree | 1af0c1041df040b69719a78e134ab8d9aa06067e /src/corelib | |
parent | 56443421cb5e537e60abd7ced42c9ebf587683fe (diff) | |
download | Qt-c79246683a5033f605acd59d1c37d68381383a06.zip Qt-c79246683a5033f605acd59d1c37d68381383a06.tar.gz Qt-c79246683a5033f605acd59d1c37d68381383a06.tar.bz2 |
don't crash in QProcessEnvironment::systemEnvironment()
as the implementations moved to platform-specific files, the
QSharedDataPointer<QProcessEnvironmentPrivate>::detach() specialization
needs to go to the private header.
Reviewed-by: thiago
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qprocess.cpp | 12 | ||||
-rw-r--r-- | src/corelib/io/qprocess_p.h | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 9ce9fd8..c2234e9 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -144,18 +144,6 @@ QT_BEGIN_NAMESPACE \sa QProcess, QProcess::systemEnvironment(), QProcess::setProcessEnvironment() */ -template<> void QSharedDataPointer<QProcessEnvironmentPrivate>::detach() -{ - if (d && d->ref == 1) - return; - QProcessEnvironmentPrivate *x = (d ? new QProcessEnvironmentPrivate(*d) - : new QProcessEnvironmentPrivate); - x->ref.ref(); - if (d && !d->ref.deref()) - delete d; - d = x; -} - QStringList QProcessEnvironmentPrivate::toList() const { QStringList result; diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h index f70579b..54d4936 100644 --- a/src/corelib/io/qprocess_p.h +++ b/src/corelib/io/qprocess_p.h @@ -182,6 +182,18 @@ public: void insert(const QProcessEnvironmentPrivate &other); }; +template<> Q_INLINE_TEMPLATE void QSharedDataPointer<QProcessEnvironmentPrivate>::detach() +{ + if (d && d->ref == 1) + return; + QProcessEnvironmentPrivate *x = (d ? new QProcessEnvironmentPrivate(*d) + : new QProcessEnvironmentPrivate); + x->ref.ref(); + if (d && !d->ref.deref()) + delete d; + d = x; +} + class QProcessPrivate : public QIODevicePrivate { public: |