Fix memory leaks.

This commit is contained in:
Roman Telezhynskyi 2023-07-24 17:51:23 +03:00
parent ec8a22cc84
commit cb4741acc9
7 changed files with 21 additions and 4 deletions

View File

@ -71,6 +71,12 @@ VPCarrousel::VPCarrousel(const VPLayoutPtr &layout, QWidget *parent) :
Refresh(); Refresh();
} }
//---------------------------------------------------------------------------------------------------------------------
VPCarrousel::~VPCarrousel()
{
delete ui;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPCarrousel::Refresh() void VPCarrousel::Refresh()
{ {

View File

@ -59,7 +59,7 @@ class VPCarrousel : public QWidget
public: public:
explicit VPCarrousel(const VPLayoutPtr &layout, QWidget *parent = nullptr); explicit VPCarrousel(const VPLayoutPtr &layout, QWidget *parent = nullptr);
~VPCarrousel() override = default; ~VPCarrousel() override;
/** /**
* @brief SetOrientation Sets the orientation to the given value and refreshes * @brief SetOrientation Sets the orientation to the given value and refreshes

View File

@ -55,6 +55,11 @@ VPLayout::VPLayout(QUndoStack *undoStack) :
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VPLayout::~VPLayout()
{
delete m_tileFactory;
}
auto VPLayout::CreateLayout(QUndoStack *undoStack) -> VPLayoutPtr auto VPLayout::CreateLayout(QUndoStack *undoStack) -> VPLayoutPtr
{ {
SCASSERT(undoStack != nullptr) SCASSERT(undoStack != nullptr)

View File

@ -45,7 +45,7 @@ class VPLayout : public QObject
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
~VPLayout() override = default; ~VPLayout() override;
static auto CreateLayout(QUndoStack *undoStack) -> VPLayoutPtr; static auto CreateLayout(QUndoStack *undoStack) -> VPLayoutPtr;
static void AddPiece(const VPLayoutPtr &layout, const VPPiecePtr &piece); static void AddPiece(const VPLayoutPtr &layout, const VPPiecePtr &piece);

View File

@ -336,6 +336,12 @@ VPSheet::VPSheet(const VPLayoutPtr &layout, QObject *parent)
SetSheetSize(QSizeF(settings->GetLayoutSheetPaperWidth(), settings->GetLayoutSheetPaperHeight())); SetSheetSize(QSizeF(settings->GetLayoutSheetPaperWidth(), settings->GetLayoutSheetPaperHeight()));
} }
//---------------------------------------------------------------------------------------------------------------------
VPSheet::~VPSheet()
{
delete m_sceneData;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VPSheet::GetLayout() const -> VPLayoutPtr auto VPSheet::GetLayout() const -> VPLayoutPtr
{ {

View File

@ -143,7 +143,7 @@ class VPSheet : public QObject
public: public:
explicit VPSheet(const VPLayoutPtr &layout, QObject *parent = nullptr); explicit VPSheet(const VPLayoutPtr &layout, QObject *parent = nullptr);
~VPSheet() override = default; ~VPSheet() override;
/** /**
* @brief GetLayout Returns the Layout of the sheet * @brief GetLayout Returns the Layout of the sheet

View File

@ -155,7 +155,7 @@ VCompleterLineEdit::VCompleterLineEdit(QWidget *parent)
: VLineEdit(parent), : VLineEdit(parent),
m_model(new QStringListModel(this)) m_model(new QStringListModel(this))
{ {
setCompleter(new MultiSelectCompleter()); setCompleter(new MultiSelectCompleter(this));
completer()->setModel(m_model); completer()->setModel(m_model);
completer()->setCompletionMode(QCompleter::PopupCompletion); completer()->setCompletionMode(QCompleter::PopupCompletion);
completer()->setCaseSensitivity(Qt::CaseInsensitive); completer()->setCaseSensitivity(Qt::CaseInsensitive);