about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedgobject2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrapped/wrappedgobject2.c')
-rw-r--r--src/wrapped/wrappedgobject2.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/wrapped/wrappedgobject2.c b/src/wrapped/wrappedgobject2.c
index 19091269..21c5f20a 100644
--- a/src/wrapped/wrappedgobject2.c
+++ b/src/wrapped/wrappedgobject2.c
@@ -39,7 +39,12 @@ typedef void*(*pFL_t)(size_t);
 #include "generated/wrappedgobject2types.h"
 static void addGObject2Alternate(library_t* lib);
 
-#define ADDED_INIT()   addGObject2Alternate(lib);
+#define ADDED_INIT() \
+    addGObject2Alternate(lib);   \
+    InitGTKClass(lib->w.bridge);
+
+#define ADDED_FINI() \
+    FiniGTKClass();
 
 #include "wrappercallback.h"
 
@@ -928,30 +933,17 @@ EXPORT void* my_g_type_value_table_peek(x64emu_t* emu, size_t type)
     if(box64_nogtk) \
         return -1;
 
-#ifdef ANDROID
 #define CUSTOM_INIT \
-    InitGTKClass(lib->w.bridge);       \
-    getMy(lib);                             \
     SetGObjectID(my->g_object_get_type());  \
     SetGInitiallyUnownedID(my->g_initially_unowned_get_type()); \
     SetGTypeName(my->g_type_name);          \
     SetGClassPeek(my->g_type_class_peek);   \
-    SetGTypeParent(my->g_type_parent);      \
-    setNeededLibs(lib, 1, "libglib-2.0.so");
+    SetGTypeParent(my->g_type_parent);
+
+#ifdef ANDROID
+#define NEEDED_LIBS "libglib-2.0.so"
 #else
-#define CUSTOM_INIT \
-    InitGTKClass(lib->w.bridge);       \
-    getMy(lib);                             \
-    SetGObjectID(my->g_object_get_type());  \
-    SetGInitiallyUnownedID(my->g_initially_unowned_get_type()); \
-    SetGTypeName(my->g_type_name);          \
-    SetGClassPeek(my->g_type_class_peek);   \
-    SetGTypeParent(my->g_type_parent);      \
-    setNeededLibs(lib, 1, "libglib-2.0.so.0");
+#define NEEDED_LIBS "libglib-2.0.so.0"
 #endif
 
-#define CUSTOM_FINI \
-    FiniGTKClass(); \
-    freeMy();
-
 #include "wrappedlib_init.h"