D14253: avoid memory leak in slave jobs

Jaime Torres Amate noreply at phabricator.kde.org
Sat Jul 21 12:20:14 BST 2018


jtamate updated this revision to Diff 38166.
jtamate edited the summary of this revision.
jtamate added a comment.


  Using --num-callers=50, the leak shows as:
  
    ==3437== 54,952 (32 direct, 54,920 indirect) bytes in 1 blocks are definitely lost in loss record 2,284 of 2,284
    ==3437==    at 0x4C2EB4F: operator new(unsigned long) (vg_replace_malloc.c:334)
    ==3437==    by 0xD7E54A9: QObjectPrivate::addConnection(int, QObjectPrivate::Connection*) (qobject.cpp:390)
    ==3437==    by 0xD7E64AC: QMetaObjectPrivate::connect(QObject const*, int, QMetaObject const*, QObject const*, int, QMetaObject const*, int, int*) (qobject.cpp:3319)
    ==3437==    by 0xD7E8D95: QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType) (qobject.cpp:2777)
    ==3437==    by 0x7B34899: QObject::connect(QObject const*, char const*, char const*, Qt::ConnectionType) const (qobject.h:465)
    ==3437==    by 0x7B94057: KIO::SlaveInterface::SlaveInterface(KIO::SlaveInterfacePrivate&, QObject*) (slaveinterface.cpp:48)
    ==3437==    by 0x7B985BC: KIO::Slave::Slave(QString const&, QObject*) (slave.cpp:216)
    ==3437==    by 0x7B99401: KIO::Slave::createSlave(QString const&, QUrl const&, int&, QString&) (slave.cpp:474)
    ==3437==    by 0x7BC321A: KIO::ProtoQueue::createSlave(QString const&, KIO::SimpleJob*, QUrl const&) (scheduler.cpp:542)
    ==3437==    by 0x7BC37CA: KIO::ProtoQueue::startAJob() (scheduler.cpp:629)
    ==3437==    by 0x7BC6FF5: KIO::ProtoQueue::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_scheduler_p.cpp:252)
  
  The slaves registered are killed and deleted, therefore register the created slave.
  This leak is gone.

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D14253?vs=38163&id=38166

REVISION DETAIL
  https://phabricator.kde.org/D14253

AFFECTED FILES
  src/core/scheduler.cpp
  src/core/slave.cpp
  src/core/slaveinterface_p.h

To: jtamate, dfaure, #frameworks, ngraham
Cc: anthonyfieroni, apol, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180721/88d33b51/attachment.html>


More information about the Kde-frameworks-devel mailing list