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:
parent
f38a639a41
commit
202df2ae89
@ -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;
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user