Commit 3a2870e7 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Fix ownership of SlideInterface

Similar to other interfaces, the lifetime of the SlideInterface should
be bound to the associated resource.


(cherry picked from commit 226dac70)
parent 6fec0b86
Pipeline #92958 passed with stage
in 8 minutes and 2 seconds
...@@ -45,7 +45,7 @@ void SlideManagerInterfacePrivate::org_kde_kwin_slide_manager_create(Resource *r ...@@ -45,7 +45,7 @@ void SlideManagerInterfacePrivate::org_kde_kwin_slide_manager_create(Resource *r
return; return;
} }
auto slide = new SlideInterface(q, slide_resource); auto slide = new SlideInterface(slide_resource);
SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s);
surfacePrivate->setSlide(QPointer<SlideInterface>(slide)); surfacePrivate->setSlide(QPointer<SlideInterface>(slide));
} }
...@@ -137,9 +137,8 @@ SlideInterfacePrivate::SlideInterfacePrivate(SlideInterface *_q, wl_resource *re ...@@ -137,9 +137,8 @@ SlideInterfacePrivate::SlideInterfacePrivate(SlideInterface *_q, wl_resource *re
{ {
} }
SlideInterface::SlideInterface(SlideManagerInterface *manager, wl_resource *resource) SlideInterface::SlideInterface(wl_resource *resource)
: QObject(manager) : d(new SlideInterfacePrivate(this, resource))
, d(new SlideInterfacePrivate(this, resource))
{ {
} }
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
qint32 offset() const; qint32 offset() const;
private: private:
explicit SlideInterface(SlideManagerInterface *manager, wl_resource *resource); explicit SlideInterface(wl_resource *resource);
friend class SlideManagerInterfacePrivate; friend class SlideManagerInterfacePrivate;
QScopedPointer<SlideInterfacePrivate> d; QScopedPointer<SlideInterfacePrivate> d;
......
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