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
(cherry picked from commit c79246683a5033f605acd59d1c37d68381383a06)
This commit is contained in:
Oswald Buddenhagen 2011-05-04 22:06:36 +02:00 committed by Olivier Goffart
parent f38a639a41
commit 202df2ae89
2 changed files with 12 additions and 12 deletions

View File

@ -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;

View File

@ -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: