[vlc-commits] [Git][videolan/vlc][master] qt: compositor_common: use unique_ptr
Thomas Guillem (@tguillem)
gitlab at videolan.org
Fri Dec 22 08:31:10 UTC 2023
Thomas Guillem pushed to branch master at VideoLAN / VLC
Commits:
806ecd96 by Alexandre Janniaux at 2023-12-22T08:04:48+00:00
qt: compositor_common: use unique_ptr
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x7fe5ed0e2002 in operator new(unsigned long) /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_new_delete.cpp:95
#1 0x7fe5d827e2f0 in vlc::DummyRenderWindow::init() ../../modules/gui/qt/maininterface/compositor_common.cpp:85
#2 0x7fe5d827ece3 in vlc::DummyRenderWindow::render() ../../modules/gui/qt/maininterface/compositor_common.cpp:91
#3 0x7fe5d8281930 in vlc::DummyRenderWindow::event(QEvent*) ../../modules/gui/qt/maininterface/compositor_common.cpp:58
#4 0x7fe5d33788fe in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/lib/libQt5Widgets.so.5+0x1788fe) (BuildId: 52d5f70b4f7ad263a7bd749141af6d1968d1f4aa)
- - - - -
2 changed files:
- modules/gui/qt/maininterface/compositor_common.cpp
- modules/gui/qt/maininterface/compositor_common.hpp
Changes:
=====================================
modules/gui/qt/maininterface/compositor_common.cpp
=====================================
@@ -30,6 +30,8 @@
using namespace vlc;
+DummyRenderWindow::~DummyRenderWindow() = default;
+
DummyRenderWindow::DummyRenderWindow(QWindow* parent)
: QWindow(parent)
{
@@ -82,7 +84,7 @@ void DummyRenderWindow::init()
if (m_initialized)
return;
m_initialized = true;
- m_backingStore = new QBackingStore(this);
+ m_backingStore = std::make_unique<QBackingStore>(this);
}
void DummyRenderWindow::render()
=====================================
modules/gui/qt/maininterface/compositor_common.hpp
=====================================
@@ -22,6 +22,8 @@
#include <QWindow>
#include <QQuickWindow>
+#include <memory>
+
namespace vlc {
/**
@@ -34,6 +36,8 @@ class DummyRenderWindow : public QWindow
{
Q_OBJECT
public:
+ ~DummyRenderWindow();
+
explicit DummyRenderWindow(QWindow* parent = nullptr);
virtual QAccessibleInterface *accessibleRoot() const override;
@@ -47,7 +51,7 @@ private:
void init();
void render();
- QBackingStore* m_backingStore = nullptr;
+ std::unique_ptr<QBackingStore> m_backingStore;
bool m_initialized = false;
};
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/806ecd968c0350c63fd0a0813851fa0de5084cca
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/806ecd968c0350c63fd0a0813851fa0de5084cca
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list