[email protected]
[Top] [All Lists]

Re: Memory leak in QSettings

Subject: Re: Memory leak in QSettings
From: Rainer Sabelka
Date: Mon, 5 Mar 2007 16:01:05 +0100
On Monday, 5. March 2007 15:35, Andrei Korostelev wrote:
> QSettings class produces a memory leak when c'tor is called.
> QSettings::QSettings(Format format, Scope scope, const QString
> &organization,  const QString &application, QObject *parent)
>     : QObject(*QSettingsPrivate::create(format, scope, organization,
> application), parent)

This constructor allocates sets the d pointer.

> the refererenced pointer created by QSettingsPrivate::create is just
> passed to the QObject and no one owes it any more which eventually leads
> to a memleak.

The d pointer is owned by the QSettings object and is deleted in the QObject 
destructor. So I don't think this will cause a memory leak.


To unsubscribe - send a mail to [email protected] with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>