D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-10-02 Thread Matthieu Gallien
This revision was automatically updated to reflect the committed changes. Closed by commit R286:b53a72743601: fix crash when more than one instances of ExtractorCollection are destructed (authored by mgallien). REPOSITORY R286 KFileMetaData CHANGES SINCE LAST UPDATE

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-10-01 Thread Matthieu Gallien
mgallien updated this revision to Diff 20200. mgallien added a comment. add a setAutoDeletePlugin method and modify the name of the enum value to not use the shared word REPOSITORY R286 KFileMetaData CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D7750?vs=19918=20200 BRANCH

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-10-01 Thread David Faure
dfaure accepted this revision. dfaure added a comment. This revision is now accepted and ready to land. Looks good. To nitpick, setAutoDeletePlugin(true) would have been clearer IMHO. (Shared sounds like shared_ptr i.e. refcounting, which isn't the case here, it's just autodelete=off)

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-25 Thread Matthieu Gallien
mgallien marked an inline comment as done. REPOSITORY R286 KFileMetaData REVISION DETAIL https://phabricator.kde.org/D7750 To: mgallien, #frameworks, dfaure Cc: dfaure, anthonyfieroni

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-25 Thread Matthieu Gallien
mgallien added a comment. Reverted most of my changes and only use a private method with two parameters to set the ExtractorPlugin in Extractor class. The second parameter should indicate if the Extractor instance is owner of the plugin or not. The private class is no longer included in

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-25 Thread Matthieu Gallien
mgallien updated this revision to Diff 19918. mgallien marked 6 inline comments as done. mgallien added a comment. add missing noexcept REPOSITORY R286 KFileMetaData CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D7750?vs=19917=19918 BRANCH fixPluginDelete REVISION DETAIL

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-25 Thread Matthieu Gallien
mgallien updated this revision to Diff 19917. mgallien added a comment. reduce the scope of modifications, use an enum to indicate if the plugin should be deleted and use private methods instead of direct access to private class REPOSITORY R286 KFileMetaData CHANGES SINCE LAST UPDATE

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-24 Thread David Faure
dfaure requested changes to this revision. dfaure added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > mgallien wrote in extractor.cpp:34 > If the Extractor is built using the move constructor, the other instance will > have a null d pointer. As far as I know,

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-19 Thread Matthieu Gallien
mgallien added a comment. I forgot to say that I do not mind modifying the patch. I am just hoping to make steady progress on it since I am having crash very often with my music player. REPOSITORY R286 KFileMetaData REVISION DETAIL https://phabricator.kde.org/D7750 To: mgallien,

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-19 Thread Matthieu Gallien
mgallien added a reviewer: dfaure. REPOSITORY R286 KFileMetaData REVISION DETAIL https://phabricator.kde.org/D7750 To: mgallien, #frameworks, dfaure Cc: dfaure, anthonyfieroni

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-19 Thread Matthieu Gallien
mgallien added inline comments. INLINE COMMENTS > anthonyfieroni wrote in extractor.cpp:34 > d *should* never be nullptr If the Extractor is built using the move constructor, the other instance will have a null d pointer. As far as I know, this is standard practice. REPOSITORY R286

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-19 Thread Anthony Fieroni
anthonyfieroni added a subscriber: dfaure. anthonyfieroni added a comment. Add @dfaure to accept it. INLINE COMMENTS > extractor.cpp:34 > { > -delete d->m_plugin; > +if (d) { > +if (d->m_pluginLoader.isLoaded()) { d *should* never be nullptr REPOSITORY R286 KFileMetaData

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-19 Thread Matthieu Gallien
mgallien added a comment. Should I push the fix in its current version ? REPOSITORY R286 KFileMetaData REVISION DETAIL https://phabricator.kde.org/D7750 To: mgallien, #frameworks Cc: anthonyfieroni

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-12 Thread Matthieu Gallien
mgallien updated this revision to Diff 19450. mgallien added a comment. remove duplicated code REPOSITORY R286 KFileMetaData CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D7750?vs=19416=19450 BRANCH fixPluginDelete REVISION DETAIL https://phabricator.kde.org/D7750 AFFECTED

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-12 Thread Anthony Fieroni
anthonyfieroni added inline comments. INLINE COMMENTS > extractor.cpp:39-46 > +if (d) { > +if (d->m_pluginLoader.isLoaded()) { > +d->m_pluginLoader.unload(); > +} else { > +delete d->m_plugin; > +} > +} Make a method to call it, here and

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-11 Thread Matthieu Gallien
mgallien updated this revision to Diff 19416. mgallien added a comment. fix another potential memory leak REPOSITORY R286 KFileMetaData CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D7750?vs=19415=19416 BRANCH fixPluginDelete REVISION DETAIL

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-11 Thread Matthieu Gallien
mgallien updated this revision to Diff 19415. mgallien added a comment. fix memory leak REPOSITORY R286 KFileMetaData CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D7750?vs=19342=19415 BRANCH fixPluginDelete REVISION DETAIL https://phabricator.kde.org/D7750 AFFECTED FILES

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-10 Thread Matthieu Gallien
mgallien added a comment. In https://phabricator.kde.org/D7750#144373, @anthonyfieroni wrote: > https://phabricator.kde.org/source/kfilemetadata/browse/master/src/extractorcollection.cpp;621101fd9e9d82be3d84f2140a4bf53ea13fd3f0$137 > Look it leak now, no? Sorry, I misread your

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-10 Thread Matthieu Gallien
mgallien added a comment. According to QPluginLoader, if one wants to release the memory, In https://phabricator.kde.org/D7750#144373, @anthonyfieroni wrote: >

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-09 Thread Anthony Fieroni
anthonyfieroni added a comment. https://phabricator.kde.org/source/kfilemetadata/browse/master/src/extractorcollection.cpp;621101fd9e9d82be3d84f2140a4bf53ea13fd3f0$137 Look it leak now, no? REPOSITORY R286 KFileMetaData REVISION DETAIL https://phabricator.kde.org/D7750 To: mgallien,

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-09 Thread Matthieu Gallien
mgallien edited the test plan for this revision. REPOSITORY R286 KFileMetaData REVISION DETAIL https://phabricator.kde.org/D7750 To: mgallien, #frameworks

D7750: fix crash when more than one instances of ExtractorCollection are destructed

2017-09-09 Thread Matthieu Gallien
mgallien created this revision. Restricted Application added a project: Frameworks. REVISION SUMMARY fix crash when more than one instances of ExtractorCollection are destructed TEST PLAN without the modification to Extractor class, the new test fails. With the fix, valgrind does not report