Bug 62215 - [PATCH] Clean up closure handling in the example domain.
Summary: [PATCH] Clean up closure handling in the example domain.
Status: RESOLVED FIXED
Alias: None
Product: realmd
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Stef Walter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 62214
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-12 09:36 UTC by Marius Vollmer
Modified: 2013-04-16 21:17 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Clean up closure handling in the example domain. (5.36 KB, patch)
2013-03-12 09:36 UTC, Marius Vollmer
Details | Splinter Review
Clean up closure handling in the example domain (5.16 KB, patch)
2013-04-15 11:29 UTC, Marius Vollmer
Details | Splinter Review

Description Marius Vollmer 2013-03-12 09:36:39 UTC
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 1 Stef Walter 2013-03-22 13:39:22 UTC
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.
Comment 2 Marius Vollmer 2013-04-12 10:03:23 UTC
(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!
Comment 3 Marius Vollmer 2013-04-15 11:29:41 UTC
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.