<table><tr><td style="">jtamate updated this revision to Diff 38163.<br />jtamate retitled this revision from "avoid memory leak over sftp" to "avoid memory leak in slave jobs".<br />jtamate edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-qcqzci3yk3kv7ss/">(Show Details)</a><br />jtamate added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D14253">View Revision</a></tr></table><br /><div><div><p>I still don't know how to avoid this leak, but I guess this will be fixed with new syntax for QMetaObject::invokeMethod and similar.</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">==26857== 22,638 (216 direct, 22,422 indirect) bytes in 3 blocks are definitely lost in loss record 2,175 of 2,182
==26857== at 0x4C2EB4F: operator new(unsigned long) (vg_replace_malloc.c:334)
==26857== by 0xD7E74CE: QObjectPrivate::connectImpl(QObject const*, int, QObject const*, void**, QtPrivate::QSlotObjectBase*, Qt::ConnectionType, int const*, QMet
aObject const*) (qobject.cpp:4834)
==26857== by 0xD7E78AC: QObject::connectImpl(QObject const*, void**, QObject const*, void**, QtPrivate::QSlotObjectBase*, Qt::ConnectionType, int const*, QMetaObj
ect const*) (qobject.cpp:4789)
==26857== by 0x7B9B21B: QMetaObject::Connection QObject::connect<void (KIO::Connection::*)(), void (KIO::Slave::*)()>(QtPrivate::FunctionPointer<void (KIO::Connec
tion::*)()>::Object const*, void (KIO::Connection::*)(), QtPrivate::FunctionPointer<void (KIO::Slave::*)()>::Object const*, void (KIO::Slave::*)(), Qt::ConnectionTyp
e) (qobject.h:254)
==26857== by 0x7B98376: KIO::Slave::accept() (slave.cpp:174)
==26857== by 0x7B9C212: QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (KIO::Slave::*)()>::call(void (KIO::Slave::*)(), KIO::Slave
*, void**) (qobjectdefs_impl.h:134)
==26857== by 0x7B9C0F0: void QtPrivate::FunctionPointer<void (KIO::Slave::*)()>::call<QtPrivate::List<>, void>(void (KIO::Slave::*)(), KIO::Slave*, void**) (qobje
ctdefs_impl.h:167)
==26857== by 0x7B9BD84: QtPrivate::QSlotObject<void (KIO::Slave::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (
qobjectdefs_impl.h:396)
==26857== by 0xD7E3BAF: QMetaObject::activate(QObject*, int, int, void**) (qobjectdefs_impl.h:376)
==26857== by 0x7C3E176: KIO::ConnectionServer::newConnection() (moc_connectionserver.cpp:127)
==26857== by 0x7C3DF93: KIO::ConnectionServer::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_connectionserver.cpp:72)
==26857== by 0xD7E3A52: QMetaObject::activate(QObject*, int, int, void**) (qobject.cpp:3771)</pre></div></div></div><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Delete</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">Making ~SlaveInterface virtual,</span> the connection <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">that has been created in the constructor</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">created in Slave constructor is now deleted. (thanks @dfaure)</span>.<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Hopefully, this connection, a member of SlaveInterface, is not c</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">C</span>hanged <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">in SlaveInterface::setConnection(C</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">to new c</span>onnect<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">ion *connection)</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> syntax</span>.<div style="padding: 8px 0;">...</div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D14253?vs=38147&id=38163">https://phabricator.kde.org/D14253?vs=38147&id=38163</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D14253">https://phabricator.kde.org/D14253</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/core/slave.cpp<br />
src/core/slaveinterface_p.h</div></div></div><br /><div><strong>To: </strong>jtamate, dfaure, Frameworks, ngraham<br /><strong>Cc: </strong>anthonyfieroni, apol, kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>