Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free resources allocated by web session once it is destructed #21618

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

dyseg
Copy link
Contributor

@dyseg dyseg commented Oct 15, 2024

Closes #20873. Maybe also #20675.

More explanation in: #20873 (comment)

@xavier2k6 xavier2k6 added WebUI WebUI-related issues/changes Performance labels Oct 15, 2024
@xavier2k6 xavier2k6 requested a review from a team October 15, 2024 20:20
@Chocobo1
Copy link
Member

@dyseg
Please split "WebUI: append port to session cookie name" commit to another PR since it is a breaking change.
I've considered it in the past but the breaking impact deters me.

src/webui/webapplication.cpp Outdated Show resolved Hide resolved
src/webui/webapplication.cpp Outdated Show resolved Hide resolved
@dyseg
Copy link
Contributor Author

dyseg commented Oct 15, 2024

@dyseg Please split "WebUI: append port to session cookie name" commit to another PR since it is a breaking change.

Done (#21619).

@glassez
Copy link
Member

glassez commented Oct 16, 2024

I would go Qt way and set session to be parent of controllers. Just add controller->setParent(this); at the end of WebSession::registerAPIController():

void WebSession::registerAPIController(const QString &scope, APIController *controller)
{
    Q_ASSERT(controller);
    m_apiControllers[scope] = controller;
    controller->setParent(this);
}

@glassez glassez changed the title WebUI: fix memory leak Free resources allocated by web session once it is destructed Oct 16, 2024
@glassez glassez added Core WebAPI WebAPI-related issues/changes and removed WebUI WebUI-related issues/changes labels Oct 16, 2024
@glassez glassez added this to the 5.0.1 milestone Oct 16, 2024
@dyseg
Copy link
Contributor Author

dyseg commented Oct 16, 2024

@glassez
Done.

glassez
glassez previously approved these changes Oct 16, 2024
Chocobo1
Chocobo1 previously approved these changes Oct 17, 2024
@glassez glassez merged commit ab8d0d1 into qbittorrent:master Oct 21, 2024
14 checks passed
@glassez
Copy link
Member

glassez commented Oct 21, 2024

@dyseg
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core WebAPI WebAPI-related issues/changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebUI: Memory Leak when multiple WebUIs are open simultaneously
4 participants