mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
renderer/native: Use g_initable_new() to create renderer
No need to do g_object_new then g_initable_init while tracking the lifetime when g_initable_new() can do it for us. https://bugzilla.gnome.org/show_bug.cgi?id=785381
This commit is contained in:
parent
78e6258b44
commit
7928b25ebf
@ -3052,16 +3052,9 @@ MetaRendererNative *
|
||||
meta_renderer_native_new (MetaMonitorManagerKms *monitor_manager_kms,
|
||||
GError **error)
|
||||
{
|
||||
MetaRendererNative *renderer_native;
|
||||
|
||||
renderer_native = g_object_new (META_TYPE_RENDERER_NATIVE,
|
||||
"monitor-manager", monitor_manager_kms,
|
||||
NULL);
|
||||
if (!g_initable_init (G_INITABLE (renderer_native), NULL, error))
|
||||
{
|
||||
g_object_unref (renderer_native);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return renderer_native;
|
||||
return g_initable_new (META_TYPE_RENDERER_NATIVE,
|
||||
NULL,
|
||||
error,
|
||||
"monitor-manager", monitor_manager_kms,
|
||||
NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user