Imported Upstream version 3.7.5.1
[platform/upstream/pygobject2.git] / gi / _gobject / gobjectmodule.c
index 304a041..96b5c94 100644 (file)
@@ -972,18 +972,18 @@ get_type_name_for_class(PyTypeObject *class)
 }
 
 
-static GStaticPrivate pygobject_construction_wrapper = G_STATIC_PRIVATE_INIT;
+static GPrivate pygobject_construction_wrapper;
 
 static inline void
 pygobject_init_wrapper_set(PyObject *wrapper)
 {
-    g_static_private_set(&pygobject_construction_wrapper, wrapper, NULL);
+    g_private_set(&pygobject_construction_wrapper, wrapper);
 }
 
 static inline PyObject *
 pygobject_init_wrapper_get(void)
 {
-    return (PyObject *) g_static_private_get(&pygobject_construction_wrapper);
+    return (PyObject *) g_private_get(&pygobject_construction_wrapper);
 }
 
 int
@@ -1034,7 +1034,7 @@ pygobject__g_instance_init(GTypeInstance   *instance,
            * now */
         PyGILState_STATE state;
         state = pyglib_gil_state_ensure();
-        wrapper = pygobject_new_full(object, FALSE, g_class);
+        wrapper = pygobject_new_full(object, TRUE, g_class);
 
         /* float the wrapper ref here because we are going to orphan it
          * so we don't destroy the wrapper. The next call to pygobject_new_full
@@ -1477,7 +1477,7 @@ pyg_object_new (PyGObject *self, PyObject *args, PyObject *kwargs)
 
     if (obj) {
         pygobject_sink (obj);
-       self = (PyGObject *) pygobject_new_full((GObject *)obj, FALSE, NULL);
+       self = (PyGObject *) pygobject_new_full((GObject *)obj, TRUE, NULL);
         g_object_unref(obj);
     } else
         self = NULL;
@@ -2117,7 +2117,9 @@ struct _PyGObject_Functions pygobject_api_functions = {
   pyg_gerror_exception_check,
 
   pyglib_option_group_new,
-  pyg_type_from_object_strict
+  pyg_type_from_object_strict,
+
+  pygobject_new_full
 };
 
 /* for addon libraries ... */
@@ -2205,7 +2207,9 @@ PYGLIB_MODULE_START(_gobject, "_gobject")
 {
     PyObject *d;
 
+#if !defined(GLIB_VERSION_2_36)
     g_type_init();
+#endif
     pyglib_init();
 
     d = PyModule_GetDict(module);