-------------------------------------------------------------------
+Wed Jun 7 00:02:18 CEST 2006 - ma@suse.de
+
+- fixed memory leak in PersistentStorage (#168690)
+
+-------------------------------------------------------------------
Tue Jun 6 22:24:00 CEST 2006 - ma@suse.de
- fixed memory leak in XMLSourceCacheParser (#168690)
// CLASS NAME : PersistentStoragePrivate
//
///////////////////////////////////////////////////////////////////
-class PersistentStorage::Private
+struct PersistentStorage::Private
{
- public:
- Backend *backend;
+ shared_ptr<Backend> backend;
};
///////////////////////////////////////////////////////////////////
// METHOD TYPE : Ctor
//
PersistentStorage::PersistentStorage()
+: d( new Private )
{
- d = new Private;
DBG << " Creating XML Files backend" << endl;
- d->backend = 0L;
}
void PersistentStorage::init(const Pathname &root)
{
- d->backend = new XMLFilesBackend(root);
+ d->backend.reset( new XMLFilesBackend(root) );
}
bool PersistentStorage::isInitialized() const
{
- return ! (d->backend == 0L);
+ return d->backend;
}
///////////////////////////////////////////////////////////////////
// Named Flags API
////////////////////////////////////////////////////////
-void
+void
PersistentStorage::setFlag( const std::string &key, const std::string &flag )
{
d->backend->setFlag(key, flag);