/** * fcitx_client_new: * * New a #FcitxClient * * Returns: A newly allocated #FcitxClient **/ FCITX_EXPORT_API FcitxClient* fcitx_client_new() { FcitxClient* self = g_object_new(FCITX_TYPE_CLIENT, NULL); return FCITX_CLIENT(self); }
FCITX_EXPORT_API FcitxClient* fcitx_client_new() { FcitxClient* self = g_object_new(FCITX_TYPE_CLIENT, NULL); if (self != NULL) { return FCITX_CLIENT(self); } else return NULL; return self; }
static void fcitx_client_finalize(GObject *object) { FcitxClient *self = FCITX_CLIENT(object); if (self->priv->icproxy) { g_dbus_proxy_call(self->priv->icproxy, "DestroyIC", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); } g_bus_unwatch_name(self->priv->watch_id); GDBusProxy* icproxy = self->priv->icproxy; GDBusProxy* improxy = self->priv->improxy; self->priv->icproxy = NULL; self->priv->improxy = NULL; if (icproxy) g_object_unref(icproxy); if (improxy) g_object_unref(improxy); if (G_OBJECT_CLASS(fcitx_client_parent_class)->finalize != NULL) G_OBJECT_CLASS(fcitx_client_parent_class)->finalize(object); }
static void fcitx_client_dispose(GObject *object) { FcitxClient *self = FCITX_CLIENT(object); if (self->priv->icproxy) { g_dbus_proxy_call(self->priv->icproxy, "DestroyIC", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); } #ifndef g_signal_handlers_disconnect_by_data #define g_signal_handlers_disconnect_by_data(instance, data) \ g_signal_handlers_disconnect_matched ((instance), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (data)) #endif g_signal_handlers_disconnect_by_data(self->priv->connection, self); g_object_unref(self->priv->connection); _fcitx_client_clean_up(self, TRUE); if (G_OBJECT_CLASS(fcitx_client_parent_class)->dispose != NULL) G_OBJECT_CLASS(fcitx_client_parent_class)->dispose(object); }