commit 0e99fc7

Michael Forney  ·  2013-06-21 08:37:18 +0000 UTC
parent 41d5b9d
surface: Remove callbacks if they are destroyed
1 files changed,  +2, -0
+2, -0
 1@@ -1,6 +1,7 @@
 2 #include "surface.h"
 3 #include "event.h"
 4 #include "region.h"
 5+#include "util.h"
 6 
 7 #include <stdlib.h>
 8 #include <stdio.h>
 9@@ -123,6 +124,7 @@ static void frame(struct wl_client * client, struct wl_resource * resource,
10 
11     callback_resource = wl_client_add_object(client, &wl_callback_interface,
12                                              NULL, id, NULL);
13+    wl_resource_set_destructor(callback_resource, &swc_remove_resource);
14     wl_list_insert(surface->pending.state.frame_callbacks.prev,
15                    wl_resource_get_link(callback_resource));
16 }