aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_dummy_partition_destroy.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgamma_dummy_partition_destroy.c')
-rw-r--r--libgamma_dummy_partition_destroy.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libgamma_dummy_partition_destroy.c b/libgamma_dummy_partition_destroy.c
new file mode 100644
index 0000000..279cc61
--- /dev/null
+++ b/libgamma_dummy_partition_destroy.c
@@ -0,0 +1,24 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+/**
+ * Release all resources held by a partition state
+ *
+ * @param this The partition state
+ */
+void
+libgamma_dummy_partition_destroy(libgamma_partition_state_t *restrict this)
+{
+ libgamma_dummy_partition_t *data = this->data;
+ size_t i;
+
+ if (data) {
+ for (i = 0; i < data->crtc_count; i++) {
+ free(data->crtcs[i].info.edid);
+ free(data->crtcs[i].info.connector_name);
+ }
+ free(data->crtcs);
+ data->crtcs = NULL;
+ }
+}