summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-03-29 11:04:27 +0200
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-03-29 11:10:57 +0200
commitdc152be5f5d5c888cddb6b4e897f621f05612297 (patch)
tree5ed5f95e9a5d51ef7640fe1a675146431b0a83dd /src/compositor/wayland_wrapper
parent37c36d4658ed9552b996b032d9fa1c6b84b14b5b (diff)
Fixed leaking of ExtendedOutput objects in the compositor.
Need to properly free them when the corresponding resource is destroyed. Change-Id: I1680a7a8b598986aace942ce647cc0f80d4c022f Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper')
-rw-r--r--src/compositor/wayland_wrapper/wlextendedoutput.cpp9
-rw-r--r--src/compositor/wayland_wrapper/wlextendedoutput.h3
2 files changed, 11 insertions, 1 deletions
diff --git a/src/compositor/wayland_wrapper/wlextendedoutput.cpp b/src/compositor/wayland_wrapper/wlextendedoutput.cpp
index c395e67e3..c3b2dbc03 100644
--- a/src/compositor/wayland_wrapper/wlextendedoutput.cpp
+++ b/src/compositor/wayland_wrapper/wlextendedoutput.cpp
@@ -78,9 +78,18 @@ ExtendedOutput::ExtendedOutput(struct wl_client *client, uint32_t id, Output *ou
Q_ASSERT(m_output->extendedOutput() == 0);
m_output->setExtendedOutput(this);
m_extended_output_resource = wl_client_add_object(client,&wl_extended_output_interface,0,id,this);
+ m_extended_output_resource->destroy = ExtendedOutput::destroy_resource;
+
sendOutputOrientation(m_compositor->screenOrientation());
}
+void ExtendedOutput::destroy_resource(wl_resource *resource)
+{
+ ExtendedOutput *output = static_cast<ExtendedOutput *>(resource->data);
+ delete output;
+ free(resource);
+}
+
void ExtendedOutput::sendOutputOrientation(Qt::ScreenOrientation orientation)
{
int sendOpperation;
diff --git a/src/compositor/wayland_wrapper/wlextendedoutput.h b/src/compositor/wayland_wrapper/wlextendedoutput.h
index c300d9b95..2d6bf5101 100644
--- a/src/compositor/wayland_wrapper/wlextendedoutput.h
+++ b/src/compositor/wayland_wrapper/wlextendedoutput.h
@@ -76,11 +76,12 @@ public:
void sendOutputOrientation(Qt::ScreenOrientation orientation);
+ static void destroy_resource(wl_resource *resource);
+
private:
struct wl_resource *m_extended_output_resource;
Output *m_output;
Compositor *m_compositor;
-
};
}