Created attachment 76379 [details] [review] Clean up closure handling in the example domain. The explicit OpData struct is not necessary, and not what the rest of the code does.
Comment on attachment 76379 [details] [review] Clean up closure handling in the example domain. Review of attachment 76379 [details] [review]: ----------------------------------------------------------------- I agree. This is better. But just one more thing. ::: service/realm-example.c @@ +142,5 @@ > GAsyncResult *res, > gpointer user_data) > { > + GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data); > + RealmExample *self = REALM_EXAMPLE (g_simple_async_result_get_op_res_gpointer (async)); You can use g_async_result_get_source_object() here. Keep in mind that it returns a reffed return value (ie: transfer full). @@ +198,4 @@ > g_simple_async_result_complete_in_idle (async); > > } else { > + g_simple_async_result_set_op_res_gpointer (async, g_object_ref (self), g_object_unref); Together with the above comment, I don't think this line is necessary. @@ +212,5 @@ > GAsyncResult *res, > gpointer user_data) > { > + GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data); > + RealmExample *self = REALM_EXAMPLE (g_simple_async_result_get_op_res_gpointer (async)); Ditto. @@ +283,4 @@ > g_simple_async_result_complete_in_idle (async); > > } else { > + g_simple_async_result_set_op_res_gpointer (async, g_object_ref (self), g_object_unref); And ditto. @@ +316,4 @@ > g_simple_async_result_complete_in_idle (async); > > } else { > + g_simple_async_result_set_op_res_gpointer (async, g_object_ref (self), g_object_unref); Again.
(In reply to comment #1) > Comment on attachment 76379 [details] [review] [review] > Clean up closure handling in the example domain. > > Review of attachment 76379 [details] [review] [review]: > ----------------------------------------------------------------- > > I agree. This is better. But just one more thing. Ok, thanks!
Created attachment 77990 [details] [review] Clean up closure handling in the example domain
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.