Bug 508576 - Simplify GTK initialization

Function gtk_init_with_args is present in the min GTK version required
so there is no need to check for it's existence and try gtk_init_check
after that.
Also g_error_free is mandatory function so no need for if(g_error_free)
g_error_free(...).

Change-Id: Idd13fb1009e0b0e434e0a409487863dd3ea06325
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h
index b23c9fb..9d76885 100644
--- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2016 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at 
@@ -20,7 +20,6 @@
 	void		(*gtk_container_add)		(GtkContainer*, GtkWidget*);
 	gint		(*gtk_dialog_run)			(GtkDialog *);
 	GtkWidget*	(*gtk_image_new_from_pixbuf)(GdkPixbuf*);
-	gboolean	(*gtk_init_check)			(int*, char***);
 	gboolean	(*gtk_init_with_args)		(int*, char***, const char *, void *, const char *, GError **);
 	GtkWidget*	(*gtk_message_dialog_new)	(GtkWindow*, GtkDialogFlags, GtkMessageType, GtkButtonsType, const gchar*, ...);
 	void		(*gtk_widget_destroy)		(GtkWidget*);
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c
index 7dbc860..0e0e827 100644
--- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at 
@@ -90,19 +90,13 @@
     }  
 
 	/* Initialize GTK. */
-    if (gtk.gtk_init_with_args) {
-        GError *error = NULL;
-        if (!gtk.gtk_init_with_args(0, NULL, NULL, NULL, NULL, &error)) {
-            if (error) {
-                fprintf(stderr, "%s: %s\n", getOfficialName(), error->message);
-                if (gtk.g_error_free) gtk.g_error_free(error);
-            }
-            return -1;
+    GError *error = NULL;
+    if (!gtk.gtk_init_with_args(0, NULL, NULL, NULL, NULL, &error)) {
+        if (error) {
+            fprintf(stderr, "%s: %s\n", getOfficialName(), error->message);
+            gtk.g_error_free(error);
         }
-    } else {
-        if (!gtk.gtk_init_check(pArgc, &argv)) {
-        	return -1;
-        }
+        return -1;
     }
 
 	/*_gdk_set_program_class(getOfficialName());*/
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c
index 15dda64..ccfea8b 100644
--- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c
@@ -33,8 +33,7 @@
 	FN_TABLE_ENTRY(gtk_container_add, 1),
 	FN_TABLE_ENTRY(gtk_dialog_run, 1),
 	FN_TABLE_ENTRY(gtk_image_new_from_pixbuf, 1),
-	FN_TABLE_ENTRY(gtk_init_check, 1),
-	FN_TABLE_ENTRY(gtk_init_with_args, 0),
+	FN_TABLE_ENTRY(gtk_init_with_args, 1),
 	FN_TABLE_ENTRY(gtk_message_dialog_new, 1),
 	FN_TABLE_ENTRY(gtk_widget_destroy, 1),
 	FN_TABLE_ENTRY(gtk_widget_destroyed, 1),