[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Sun Jan 10 22:18:57 CET 2010
SVN commit 1072758 by jmhoffmann:
Use QObject's memory management to prevent DownloadQueueSet's from leaking
once HttpDownloadManager::addDownloadPolicy is in use.
M +5 -3 DownloadQueueSet.cpp
M +2 -2 DownloadQueueSet.h
M +1 -1 HttpDownloadManager.cpp
--- trunk/KDE/kdeedu/marble/src/lib/DownloadQueueSet.cpp #1072757:1072758
@@ -22,12 +22,14 @@
namespace Marble
{
-DownloadQueueSet::DownloadQueueSet()
+DownloadQueueSet::DownloadQueueSet( QObject * parent )
+ : QObject( parent )
{
}
-DownloadQueueSet::DownloadQueueSet( DownloadPolicy const & policy )
- : m_downloadPolicy( policy )
+DownloadQueueSet::DownloadQueueSet( DownloadPolicy const & policy, QObject * parent )
+ : QObject( parent ),
+ m_downloadPolicy( policy )
{
}
--- trunk/KDE/kdeedu/marble/src/lib/DownloadQueueSet.h #1072757:1072758
@@ -74,8 +74,8 @@
Q_OBJECT
public:
- DownloadQueueSet();
- explicit DownloadQueueSet( const DownloadPolicy& policy );
+ explicit DownloadQueueSet( QObject * parent = 0 );
+ explicit DownloadQueueSet( const DownloadPolicy& policy, QObject * parent = 0 );
~DownloadQueueSet();
DownloadPolicy downloadPolicy() const;
--- trunk/KDE/kdeedu/marble/src/lib/HttpDownloadManager.cpp #1072757:1072758
@@ -148,7 +148,7 @@
void HttpDownloadManager::addDownloadPolicy( const DownloadPolicy& policy )
{
- DownloadQueueSet * const queueSet = new DownloadQueueSet( policy );
+ DownloadQueueSet * const queueSet = new DownloadQueueSet( policy, this );
connectQueueSet( queueSet );
d->m_queueSets.append( QPair<DownloadPolicyKey, DownloadQueueSet *>
( queueSet->downloadPolicy().key(), queueSet ));
More information about the Marble-commits
mailing list