/** @fn static void vehicle_file_disable_watch(struct vehicle_priv *priv) ***************************************************************************** * @b Description: Disable watch ***************************************************************************** * @param priv : pointer on the private data of the plugin ***************************************************************************** **/ static void vehicle_file_disable_watch(struct vehicle_priv *priv) { dbg(1, "vehicle_file_disable_watch : enter\n"); #ifdef _WIN32 if (priv->timeout) { event_remove_timeout(priv->timeout); priv->timeout=NULL; // dangling pointer! prevent double freeing. } #else if (priv->watch) event_remove_watch(priv->watch); priv->watch = NULL; #endif }
static void graphics_opengl_x11_destroy(struct graphics_opengl_window_system *x11) { if (x11->watch) event_remove_watch(x11->watch); if (x11->cb) callback_destroy(x11->cb); if (x11->display) { if (x11->window) XDestroyWindow(x11->display, x11->window); if (x11->colormap) XFreeColormap(x11->display, x11->colormap); XCloseDisplay(x11->display); } g_free(x11); }