···139139140140 ipc_server_client_destroy_compositor(ics);
141141142142+ // Make sure undestroyed spaces are unreferenced
143143+ for (uint32_t i = 0; i < IPC_MAX_CLIENT_SPACES; i++) {
144144+ // Cast away volatile.
145145+ xrt_space_reference((struct xrt_space **)&ics->xspcs[i], NULL);
146146+ }
147147+142148 // Should we stop the server when a client disconnects?
143149 if (ics->server->exit_on_disconnect) {
144150 ics->server->running = false;
···199205 os_mutex_unlock(&ics->server->global_state.lock);
200206201207 ipc_server_client_destroy_compositor(ics);
208208+209209+ // Make sure undestroyed spaces are unreferenced
210210+ for (uint32_t i = 0; i < IPC_MAX_CLIENT_SPACES; i++) {
211211+ // Cast away volatile.
212212+ xrt_space_reference((struct xrt_space **)&ics->xspcs[i], NULL);
213213+ }
202214203215 // Should we stop the server when a client disconnects?
204216 if (ics->server->exit_on_disconnect) {