D9120: Fix a memory leak

2017-12-03 Thread Jaime Torres Amate
jtamate abandoned this revision. jtamate added a comment. The new revision is https://phabricator.kde.org/D9156 REPOSITORY R249 KI18n REVISION DETAIL https://phabricator.kde.org/D9120 To: jtamate, #frameworks Cc: mpyne, anthonyfieroni, aacid, apol

D9120: Fix a memory leak

2017-12-03 Thread Michael Pyne
mpyne added a comment. I think `~KuitStaticData()` *does* delete domainSetups. But deleting that QHash doesn't delete the underlying values. That means the real leak is at "Kuit::setupForDomain(QByteArray const&) (kuitmarkup.cpp:504)". If that's the case, then adding a destructor to th

D9120: Fix a memory leak

2017-12-03 Thread Anthony Fieroni
anthonyfieroni added a comment. It should not deleted in KuitFormatterPrivate, it's in static data object. ~KuitStaticData should delete domainSetups. REPOSITORY R249 KI18n REVISION DETAIL https://phabricator.kde.org/D9120 To: jtamate, #frameworks Cc: anthonyfieroni, aacid, apol

D9120: Fix a memory leak

2017-12-03 Thread Albert Astals Cid
aacid added a comment. In https://phabricator.kde.org/D9120#174876, @jtamate wrote: > As I understand the problem, the reference was created (as a pointer) in setupForDomain, but was stored in a local reference in format (line 1221). > As I'm not sure about the lifetime of the referenc

D9120: Fix a memory leak

2017-12-03 Thread Jaime Torres Amate
jtamate added a comment. As I understand the problem, the reference was created (as a pointer) in setupForDomain, but was stored in a local reference in format (line 1221). As I'm not sure about the lifetime of the reference, I just delete it in the destructor. REPOSITORY R249 KI18n REV

D9120: Fix a memory leak

2017-12-03 Thread Aleix Pol Gonzalez
apol added inline comments. INLINE COMMENTS > kuitmarkup.cpp:1213 > { > +delete setup; > } That's really weird, are we deleting something that was returned to us by reference? Looks like the issue is in setupForDomain... REPOSITORY R249 KI18n REVISION DETAIL https://phabricator.kde

D9120: Fix a memory leak

2017-12-03 Thread Jaime Torres Amate
jtamate created this revision. jtamate added a reviewer: Frameworks. Restricted Application added a project: Frameworks. REVISION SUMMARY setup was created but never released, now changed to a member pointer to be deleted in the destructor. According to valgrind, the leak is gone. TEST PLAN