Bug 425475 - deleteLater calls only once in libzip / libarchive plugins destructor
Summary: deleteLater calls only once in libzip / libarchive plugins destructor
Status: REPORTED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-17 22:46 UTC by krab
Modified: 2020-09-03 09:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description krab 2020-08-17 22:46:05 UTC
STEPS TO REPRODUCE
1. disable all plugins but libzipplugin, restart ark
2. download test file https://download.qt.io/official_releases/qt/5.15/5.15.0/submodules/qtbase-everywhere-src-5.15.0.zip
3. merge zip_fclose fixes https://invent.kde.org/utilities/ark/-/merge_requests/4
3. open test zip in ark, now reopen it multiple times via menu "Open Recent"

It happens because https://invent.kde.org/utilities/ark/-/blob/master/plugins/libzipplugin/libzipplugin.cpp#L66 this calls only once instead of 25361 times and m_emmitedEntries never deleted at all.

if you test debugs like this:

libzipplugin.cpp:

LibzipPlugin::~LibzipPlugin()
{
    qDebug() << __PRETTY_FUNCTION__ << thread();
    for (auto e : m_emittedEntries) {
        qDebug() << "e:" << e->name();
        // Entries might be passed to pending slots, so we just schedule their deletion.
        e->deleteLater();
    }
}

archiveentry.cpp:
Archive::Entry::~Entry()
{
    qDebug() << __FUNCTION__;
}

you will notice that only last entry from m_emittedEntries actually calls deleteLater().

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon
(available in About System)
KDE Plasma Version: 5.19.4
KDE Frameworks Version: 5.72.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
Comment 1 Christoph Feck 2020-09-03 09:56:14 UTC
Thank you for the investigation and report. Could you try submitting a patch to our GitLab server? For more information, please see https://community.kde.org/Get_Involved/development#Submit_a_Merge_Request