Commit db91050f authored by Xaver Hugl's avatar Xaver Hugl
Browse files

dmabuf-feedback: fix crash

BUG: 446502
parent 53064d9a
......@@ -25,7 +25,7 @@ static const int s_version = 4;
LinuxDmaBufV1ClientBufferIntegrationPrivate::LinuxDmaBufV1ClientBufferIntegrationPrivate(LinuxDmaBufV1ClientBufferIntegration *q, Display *display)
: QtWaylandServer::zwp_linux_dmabuf_v1(*display, s_version)
, q(q)
, defaultFeedback(new LinuxDmaBufV1Feedback(q))
, defaultFeedback(new LinuxDmaBufV1Feedback(this))
{
}
......@@ -66,7 +66,7 @@ void LinuxDmaBufV1ClientBufferIntegrationPrivate::zwp_linux_dmabuf_v1_get_surfac
}
auto surfacePrivate = SurfaceInterfacePrivate::get(surface);
if (!surfacePrivate->dmabufFeedbackV1) {
surfacePrivate->dmabufFeedbackV1.reset(new LinuxDmaBufV1Feedback(q));
surfacePrivate->dmabufFeedbackV1.reset(new LinuxDmaBufV1Feedback(this));
}
LinuxDmaBufV1FeedbackPrivate::get(surfacePrivate->dmabufFeedbackV1.data())->add(resource->client(), id, resource->version());
}
......@@ -86,11 +86,6 @@ void LinuxDmaBufV1ClientBufferIntegrationPrivate::zwp_linux_dmabuf_v1_create_par
new LinuxDmaBufParamsV1(q, paramsResource);
}
LinuxDmaBufV1ClientBufferIntegrationPrivate *LinuxDmaBufV1ClientBufferIntegrationPrivate::get(LinuxDmaBufV1ClientBufferIntegration *integration)
{
return integration->d.data();
}
LinuxDmaBufParamsV1::LinuxDmaBufParamsV1(LinuxDmaBufV1ClientBufferIntegration *integration, ::wl_resource *resource)
: QtWaylandServer::zwp_linux_buffer_params_v1(resource)
, m_integration(integration)
......@@ -437,8 +432,8 @@ ClientBuffer::Origin LinuxDmaBufV1ClientBuffer::origin() const
}
}
LinuxDmaBufV1Feedback::LinuxDmaBufV1Feedback(LinuxDmaBufV1ClientBufferIntegration *integration)
: d(new LinuxDmaBufV1FeedbackPrivate(LinuxDmaBufV1ClientBufferIntegrationPrivate::get(integration)))
LinuxDmaBufV1Feedback::LinuxDmaBufV1Feedback(LinuxDmaBufV1ClientBufferIntegrationPrivate *integration)
: d(new LinuxDmaBufV1FeedbackPrivate(integration))
{
}
......
......@@ -135,7 +135,7 @@ public:
void setTranches(const QVector<Tranche> &tranches);
private:
LinuxDmaBufV1Feedback(LinuxDmaBufV1ClientBufferIntegration *integration);
LinuxDmaBufV1Feedback(LinuxDmaBufV1ClientBufferIntegrationPrivate *integration);
friend class LinuxDmaBufV1ClientBufferIntegrationPrivate;
friend class LinuxDmaBufV1FeedbackPrivate;
QScopedPointer<LinuxDmaBufV1FeedbackPrivate> d;
......
......@@ -39,8 +39,6 @@ public:
dev_t mainDevice;
QHash<uint32_t, QSet<uint64_t>> supportedModifiers;
static LinuxDmaBufV1ClientBufferIntegrationPrivate *get(LinuxDmaBufV1ClientBufferIntegration *integration);
protected:
void zwp_linux_dmabuf_v1_bind_resource(Resource *resource) override;
void zwp_linux_dmabuf_v1_destroy(Resource *resource) override;
......
Supports Markdown
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