aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/servers/crtc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/servers/crtc.c b/src/servers/crtc.c
index df274f8..96e3a84 100644
--- a/src/servers/crtc.c
+++ b/src/servers/crtc.c
@@ -205,11 +205,24 @@ int merge_state(struct output* restrict old_outputs, size_t old_outputs_n)
*/
int disconnect(void)
{
+ size_t i;
+
if (!connected)
return 0;
connected = 0;
- return 0; /* TODO disconnect() */
+ for (i = 0; i < outputs_n; i++)
+ {
+ outputs[i].crtc = NULL;
+ libgamma_crtc_destroy(crtcs + i);
+ }
+ free(crtcs), crtcs = NULL;
+ for (i = 0; i < site.partitions_available; i++)
+ libgamma_partition_destroy(partitions + i);
+ free(partitions), partitions = NULL;
+ libgamma_site_destroy(&site);
+
+ return 0;
}