*/
#pragma once
+/**
+ * Frees an i3Window and all its members.
+ *
+ */
+void window_free(i3Window *win);
+
/**
* Updates the WM_CLASS (consisting of the class and instance) for the
* given window.
}
}
}
+ if (nc->window != cwindow && nc->window != NULL) {
+ window_free(nc->window);
+ }
nc->window = cwindow;
x_reinit(nc);
add_ignore_event(cookie.sequence, 0);
}
ipc_send_window_event("close", con);
- FREE(con->window->class_class);
- FREE(con->window->class_instance);
- i3string_free(con->window->name);
- FREE(con->window->ran_assignments);
- FREE(con->window);
+ window_free(con->window);
+ con->window = NULL;
}
Con *ws = con_get_workspace(con);
*/
#include "all.h"
+/*
+ * Frees an i3Window and all its members.
+ *
+ */
+void window_free(i3Window *win) {
+ FREE(win->class_class);
+ FREE(win->class_instance);
+ i3string_free(win->name);
+ FREE(win->ran_assignments);
+ FREE(win);
+}
+
/*
* Updates the WM_CLASS (consisting of the class and instance) for the
* given window.