[at-spi2-core] Don't check for NULL when calling _atspi_application_new



commit 3c21b42d31fd19c28bca9417c66bbd5c9fa4c6f8
Author: Mike Gorse <mgorse suse com>
Date:   Mon Sep 17 11:16:08 2012 -0500

    Don't check for NULL when calling _atspi_application_new
    
    g_object_new will error out rather than return NULL when out of memory,
    so no need to check its return value.

 atspi/atspi-application.c |    7 ++-----
 atspi/atspi-misc.c        |    1 -
 2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/atspi/atspi-application.c b/atspi/atspi-application.c
index 49124ba..9039190 100644
--- a/atspi/atspi-application.c
+++ b/atspi/atspi-application.c
@@ -85,10 +85,7 @@ _atspi_application_new (const gchar *bus_name)
   AtspiApplication *application;
   
   application = g_object_new (ATSPI_TYPE_APPLICATION, NULL);
-  if (application)
-  {
-    application->bus_name = g_strdup (bus_name);
-    application->root = NULL;
-  }
+  application->bus_name = g_strdup (bus_name);
+  application->root = NULL;
   return application;
 }
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 0366fc4..fa7ca64 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -205,7 +205,6 @@ get_application (const char *bus_name)
   if (!bus_name_dup) return NULL;
   // TODO: change below to something that will send state-change:defunct notification if necessary */
   app = _atspi_application_new (bus_name);
-  if (!app) return NULL;
   app->hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
   app->bus = dbus_connection_ref (_atspi_bus ());
   gettimeofday (&app->time_added, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]