mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
use constructor/destructor macros
Initialize global images at load time: - make sure these stuff are initialized without using runtime resources; - make sure stuff are initialize really earlier. Do not use atexit function but a destructor. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
parent
088add2b98
commit
44a97b6095
@ -961,13 +961,6 @@ void red_qxl_init(RedsState *reds, QXLInstance *qxl)
|
||||
|
||||
spice_return_if_fail(qxl != NULL);
|
||||
|
||||
static gsize initialized = FALSE;
|
||||
if (g_once_init_enter(&initialized)) {
|
||||
quic_init();
|
||||
sw_canvas_init();
|
||||
g_once_init_leave(&initialized, TRUE);
|
||||
}
|
||||
|
||||
qxl_state = spice_new0(QXLState, 1);
|
||||
qxl_state->reds = reds;
|
||||
qxl_state->qxl = qxl;
|
||||
|
||||
@ -2801,7 +2801,7 @@ static void reds_cleanup(RedsState *reds)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void reds_exit(void)
|
||||
SPICE_DESTRUCTOR_FUNC(reds_exit)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
@ -3335,7 +3335,6 @@ static void reds_init_vd_agent_resources(RedsState *reds)
|
||||
|
||||
static int do_spice_init(RedsState *reds, SpiceCoreInterface *core_interface)
|
||||
{
|
||||
static gboolean first = TRUE;
|
||||
spice_info("starting %s", VERSION);
|
||||
|
||||
if (core_interface->base.major_version != SPICE_INTERFACE_CORE_MAJOR) {
|
||||
@ -3416,10 +3415,6 @@ static int do_spice_init(RedsState *reds, SpiceCoreInterface *core_interface)
|
||||
if (reds->allow_multiple_clients) {
|
||||
spice_warning("spice: allowing multiple client connections");
|
||||
}
|
||||
if (first) {
|
||||
atexit(reds_exit);
|
||||
first = FALSE;
|
||||
}
|
||||
servers = g_list_prepend(servers, reds);
|
||||
return 0;
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 00db44087807335e74c8f65ea3e6fde0b684e7db
|
||||
Subproject commit 5b6be16b37370bb774aa3c2a7d5c41791fdc3a1e
|
||||
Loading…
Reference in New Issue
Block a user