qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

Free resources allocated by web session once it is destructed

Open dyseg opened this issue 1 year ago • 4 comments

Closes #20873. Maybe also #20675.

More explanation in: https://github.com/qbittorrent/qBittorrent/issues/20873#issuecomment-2408992631

dyseg avatar Oct 15 '24 19:10 dyseg

@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.

Chocobo1 avatar Oct 15 '24 20:10 Chocobo1

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

Done (#21619).

dyseg avatar Oct 15 '24 21:10 dyseg

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 avatar Oct 16 '24 18:10 glassez

@glassez Done.

dyseg avatar Oct 16 '24 18:10 dyseg

@dyseg Thank you!

glassez avatar Oct 21 '24 06:10 glassez