[mutter] renderer/native: Use g_initable_new() to create renderer
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] renderer/native: Use g_initable_new() to create renderer
- Date: Fri, 6 Oct 2017 18:26:22 +0000 (UTC)
commit 7928b25ebfa386e9e9360c85f3cb58f38d5ebc7c
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Oct 5 10:47:25 2017 -0400
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
src/backends/native/meta-renderer-native.c | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index fb34e35..a710363 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]