Commit 041ce7b5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix mem leak

parent a857db81
Pipeline #25408 passed with stage
in 80 minutes and 31 seconds
......@@ -48,6 +48,16 @@
using namespace MessageViewer;
MessagePartRendererFactoryPrivate::~MessagePartRendererFactoryPrivate()
{
QHashIterator<QByteArray, std::vector<RendererInfo> > i(m_renderers);
while (i.hasNext()) {
i.next();
auto renderInfo = i.value();
renderInfo.erase(renderInfo.begin(), renderInfo.end());
}
}
void MessagePartRendererFactoryPrivate::setup()
{
if (m_renderers.isEmpty()) {
......
......@@ -49,6 +49,7 @@ struct RendererInfo
class MessagePartRendererFactoryPrivate
{
public:
~MessagePartRendererFactoryPrivate();
void setup();
void loadPlugins();
void initialize_builtin_renderers();
......
......@@ -50,6 +50,16 @@ BodyPartFormatterFactoryPrivate::BodyPartFormatterFactoryPrivate(BodyPartFormatt
{
}
BodyPartFormatterFactoryPrivate::~BodyPartFormatterFactoryPrivate()
{
QHashIterator<QString, std::vector<FormatterInfo> > i(registry);
while (i.hasNext()) {
i.next();
auto formatterInfo = i.value();
formatterInfo.erase(formatterInfo.begin(), formatterInfo.end());
}
}
void BodyPartFormatterFactoryPrivate::setup()
{
if (registry.empty()) {
......
......@@ -44,7 +44,7 @@ class BodyPartFormatterFactoryPrivate
{
public:
explicit BodyPartFormatterFactoryPrivate(BodyPartFormatterFactory *factory);
~BodyPartFormatterFactoryPrivate() = default;
~BodyPartFormatterFactoryPrivate();
void setup();
void messageviewer_create_builtin_bodypart_formatters(); //defined in bodypartformatter.cpp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment