Fix a memory leak
The dynamically allocated QtWayland::zwlr_layer_shell_v1 object in QWaylandLayerShellIntegration::registryLayer() isn't deleted anywhere.
This commit is contained in:
parent
efd32eed53
commit
93f3ed2c07
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
namespace LayerShellQt
|
namespace LayerShellQt
|
||||||
{
|
{
|
||||||
QWaylandLayerShell::QWaylandLayerShell(QtWayland::zwlr_layer_shell_v1 *shell)
|
QWaylandLayerShell::QWaylandLayerShell(::wl_registry *registry, uint32_t id, uint32_t version)
|
||||||
: QtWayland::zwlr_layer_shell_v1(shell->object())
|
: QtWayland::zwlr_layer_shell_v1(registry, id, version)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace LayerShellQt
|
||||||
class LAYERSHELLQT_EXPORT QWaylandLayerShell : public QtWayland::zwlr_layer_shell_v1
|
class LAYERSHELLQT_EXPORT QWaylandLayerShell : public QtWayland::zwlr_layer_shell_v1
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QWaylandLayerShell(QtWayland::zwlr_layer_shell_v1 *shell);
|
QWaylandLayerShell(::wl_registry *registry, uint32_t id, uint32_t version);
|
||||||
virtual ~QWaylandLayerShell();
|
virtual ~QWaylandLayerShell();
|
||||||
|
|
||||||
QWaylandLayerSurface *createLayerSurface(QtWaylandClient::QWaylandWindow *window);
|
QWaylandLayerSurface *createLayerSurface(QtWaylandClient::QWaylandWindow *window);
|
||||||
|
|
|
@ -35,7 +35,7 @@ void QWaylandLayerShellIntegration::registryLayer(void *data, struct wl_registry
|
||||||
QWaylandLayerShellIntegration *shell = static_cast<QWaylandLayerShellIntegration *>(data);
|
QWaylandLayerShellIntegration *shell = static_cast<QWaylandLayerShellIntegration *>(data);
|
||||||
|
|
||||||
if (interface == zwlr_layer_shell_v1_interface.name)
|
if (interface == zwlr_layer_shell_v1_interface.name)
|
||||||
shell->m_layerShell = new QWaylandLayerShell(new QtWayland::zwlr_layer_shell_v1(registry, id, std::min(version, 4u)));
|
shell->m_layerShell = new QWaylandLayerShell(registry, id, std::min(version, 4u));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue