static void vnc_display_close(VncDisplay *vd)

{

    size_t i;

    if (!vd) {

        return;

    }

    vd->is_unix = false;

    for (i = 0; i < vd->nlsock; i++) {

        if (vd->lsock_tag[i]) {

            g_source_remove(vd->lsock_tag[i]);

        }

        object_unref(OBJECT(vd->lsock[i]));

    }

    g_free(vd->lsock);

    g_free(vd->lsock_tag);

    vd->lsock = NULL;

    vd->lsock_tag = NULL;

    vd->nlsock = 0;



    for (i = 0; i < vd->nlwebsock; i++) {

        if (vd->lwebsock_tag[i]) {

            g_source_remove(vd->lwebsock_tag[i]);

        }

        object_unref(OBJECT(vd->lwebsock[i]));

    }

    g_free(vd->lwebsock);

    g_free(vd->lwebsock_tag);

    vd->lwebsock = NULL;

    vd->lwebsock_tag = NULL;

    vd->nlwebsock = 0;



    vd->auth = VNC_AUTH_INVALID;

    vd->subauth = VNC_AUTH_INVALID;

    if (vd->tlscreds) {

        object_unparent(OBJECT(vd->tlscreds));

        vd->tlscreds = NULL;

    }

    g_free(vd->tlsaclname);

    vd->tlsaclname = NULL;

    if (vd->lock_key_sync) {

        qemu_remove_led_event_handler(vd->led);


    }

}
static void vnc_display_close(VncDisplay *vd)

{

    size_t i;

    if (!vd) {

        return;

    }

    vd->is_unix = false;

    for (i = 0; i < vd->nlsock; i++) {

        if (vd->lsock_tag[i]) {

            g_source_remove(vd->lsock_tag[i]);

        }

        object_unref(OBJECT(vd->lsock[i]));

    }

    g_free(vd->lsock);

    g_free(vd->lsock_tag);

    vd->lsock = NULL;

    vd->lsock_tag = NULL;

    vd->nlsock = 0;



    for (i = 0; i < vd->nlwebsock; i++) {

        if (vd->lwebsock_tag[i]) {

            g_source_remove(vd->lwebsock_tag[i]);

        }

        object_unref(OBJECT(vd->lwebsock[i]));

    }

    g_free(vd->lwebsock);

    g_free(vd->lwebsock_tag);

    vd->lwebsock = NULL;

    vd->lwebsock_tag = NULL;

    vd->nlwebsock = 0;



    vd->auth = VNC_AUTH_INVALID;

    vd->subauth = VNC_AUTH_INVALID;

    if (vd->tlscreds) {

        object_unparent(OBJECT(vd->tlscreds));

        vd->tlscreds = NULL;

    }

    g_free(vd->tlsaclname);

    vd->tlsaclname = NULL;

    if (vd->lock_key_sync) {

        qemu_remove_led_event_handler(vd->led);


    }

}
static void FUNC_0(VncDisplay *VAR_0)

{

    size_t i;

    if (!VAR_0) {

        return;

    }

    VAR_0->is_unix = false;

    for (i = 0; i < VAR_0->nlsock; i++) {

        if (VAR_0->lsock_tag[i]) {

            g_source_remove(VAR_0->lsock_tag[i]);

        }

        object_unref(OBJECT(VAR_0->lsock[i]));

    }

    g_free(VAR_0->lsock);

    g_free(VAR_0->lsock_tag);

    VAR_0->lsock = NULL;

    VAR_0->lsock_tag = NULL;

    VAR_0->nlsock = 0;



    for (i = 0; i < VAR_0->nlwebsock; i++) {

        if (VAR_0->lwebsock_tag[i]) {

            g_source_remove(VAR_0->lwebsock_tag[i]);

        }

        object_unref(OBJECT(VAR_0->lwebsock[i]));

    }

    g_free(VAR_0->lwebsock);

    g_free(VAR_0->lwebsock_tag);

    VAR_0->lwebsock = NULL;

    VAR_0->lwebsock_tag = NULL;

    VAR_0->nlwebsock = 0;



    VAR_0->auth = VNC_AUTH_INVALID;

    VAR_0->subauth = VNC_AUTH_INVALID;

    if (VAR_0->tlscreds) {

        object_unparent(OBJECT(VAR_0->tlscreds));

        VAR_0->tlscreds = NULL;

    }

    g_free(VAR_0->tlsaclname);

    VAR_0->tlsaclname = NULL;

    if (VAR_0->lock_key_sync) {

        qemu_remove_led_event_handler(VAR_0->led);


    }

}
static void FUNC_0(VncDisplay *VAR_0)
{ size_t i; if (!VAR_0) { return; } VAR_0->is_unix = false; for (i = 0; i < VAR_0->nlsock; i++) { if (VAR_0->lsock_tag[i]) { g_source_remove(VAR_0->lsock_tag[i]); } object_unref(OBJECT(VAR_0->lsock[i])); } g_free(VAR_0->lsock); g_free(VAR_0->lsock_tag); VAR_0->lsock = NULL; VAR_0->lsock_tag = NULL; VAR_0->nlsock = 0; for (i = 0; i < VAR_0->nlwebsock; i++) { if (VAR_0->lwebsock_tag[i]) { g_source_remove(VAR_0->lwebsock_tag[i]); } object_unref(OBJECT(VAR_0->lwebsock[i])); } g_free(VAR_0->lwebsock); g_free(VAR_0->lwebsock_tag); VAR_0->lwebsock = NULL; VAR_0->lwebsock_tag = NULL; VAR_0->nlwebsock = 0; VAR_0->auth = VNC_AUTH_INVALID; VAR_0->subauth = VNC_AUTH_INVALID; if (VAR_0->tlscreds) { object_unparent(OBJECT(VAR_0->tlscreds)); VAR_0->tlscreds = NULL; } g_free(VAR_0->tlsaclname); VAR_0->tlsaclname = NULL; if (VAR_0->lock_key_sync) { qemu_remove_led_event_handler(VAR_0->led); } }