On Tue, Feb 26, 2013 at 01:36:23AM +0100, Marc-André Lureau wrote: > Never call vevent_get_next_vevent() before calling vcard_emul_init() > > Some mutexes are initialized in vevent_queue_init(), during emul_init() A bit more details about what's going on in spice-gtk code could be nice (the monitor is created in the instance _init function and calls vevent_get_next_vevent() when a smartcard event occurs, but vcard_emul_init() is only called asynchronously from a thread from _init_async(), so this can be racy, this commit moves the monitor creation after _init_async has completed). > /** > @@ -512,17 +518,19 @@ gboolean spice_smartcard_manager_init_finish(SpiceSession *session, > GAsyncResult *result, > GError **err) > { > + GSimpleAsyncResult *simple; > + > g_return_val_if_fail(SPICE_IS_SESSION(session), FALSE); > - g_return_val_if_fail(G_IS_ASYNC_RESULT(result), FALSE); > + g_return_val_if_fail(G_IS_SIMPLE_ASYNC_RESULT(result), FALSE); > > SPICE_DEBUG("smartcard_manager_finish"); > > - if (G_IS_SIMPLE_ASYNC_RESULT(result)) { > - GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(result); > - g_warn_if_fail(g_simple_async_result_get_source_tag(simple) == spice_smartcard_manager_init); > - if (g_simple_async_result_propagate_error(simple, err)) > - return FALSE; > - } > + simple = G_SIMPLE_ASYNC_RESULT(result); > + g_return_val_if_fail(g_simple_async_result_get_source_tag(simple) == spice_smartcard_manager_init, FALSE); > + if (g_simple_async_result_propagate_error(simple, err)) > + return FALSE; > + This part looks like a code cleanup unrelated to this fix. Looks good otherwise. Christophe
Attachment:
pgp3Gojo_y2fM.pgp
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel