static Eina_Bool _cb_connect_data(void *data, Ecore_Fd_Handler *hdl);
static Eina_Bool _ecore_wl2_display_connect(Ecore_Wl2_Display *ewd, Eina_Bool sync);
+void
+_display_event_free(void *d, void *event EINA_UNUSED)
+{
+ ecore_wl2_display_disconnect(d);
+}
+
static void
_ecore_wl2_display_event(Ecore_Wl2_Display *ewd, int event)
{
ev = calloc(1, sizeof(Ecore_Wl2_Event_Connect));
EINA_SAFETY_ON_NULL_RETURN(ev);
ev->display = ewd;
- ecore_event_add(event, ev, NULL, NULL);
+ ewd->refs++;
+ ecore_event_add(event, ev, _display_event_free, ewd);
}
static void
ev = event;
eina_stringshare_del(ev->interface);
+ ecore_wl2_display_disconnect(ev->display);
free(ev);
}
ev->id = id;
ev->display = ewd;
+ ewd->refs++;
ev->version = version;
ev->interface = eina_stringshare_add(interface);
ev->id = id;
ev->display = ewd;
+ ewd->refs++;
ev->version = global->version;
ev->interface = eina_stringshare_add(global->interface);
if (!ev) return;
ev->display = ewd;
- ecore_event_add(ECORE_WL2_EVENT_SYNC_DONE, ev, NULL, NULL);
+ ewd->refs++;
+ ecore_event_add(ECORE_WL2_EVENT_SYNC_DONE, ev, _display_event_free, ewd);
}
static const struct wl_callback_listener _sync_listener =
} Ecore_Wl2_Event_Window_WWW_Drag;
Ecore_Wl2_Window *_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface);
+void _display_event_free(void *d, void *event EINA_UNUSED);
void _ecore_wl2_output_add(Ecore_Wl2_Display *display, unsigned int id);
void _ecore_wl2_output_del(Ecore_Wl2_Output *output);