summaryrefslogtreecommitdiff
path: root/loaders/lua5.1
diff options
context:
space:
mode:
authorGarrett Regier <garrettregier@gmail.com>2015-11-20 02:24:22 -0800
committerGarrett Regier <garrettregier@gmail.com>2015-12-15 16:57:45 -0800
commit4480c359be81c2d01cbfce10fe3f1de7ca3cfaf4 (patch)
tree17fc4a814b935b03ef93b8f29b03cf267c4205b7 /loaders/lua5.1
parent593503693c7ced999f20f12c772296736ed3e7b8 (diff)
downloadlibpeas-4480c359be81c2d01cbfce10fe3f1de7ca3cfaf4.tar.gz
Initialize the peas-extension-type quark in class_init when possible
Diffstat (limited to 'loaders/lua5.1')
-rw-r--r--loaders/lua5.1/peas-plugin-loader-lua.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/loaders/lua5.1/peas-plugin-loader-lua.c b/loaders/lua5.1/peas-plugin-loader-lua.c
index d4a78bb..389dcee 100644
--- a/loaders/lua5.1/peas-plugin-loader-lua.c
+++ b/loaders/lua5.1/peas-plugin-loader-lua.c
@@ -54,8 +54,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (PeasPluginLoaderLua,
#define GET_PRIV(o) \
(peas_plugin_loader_lua_get_instance_private (o))
-static
-G_DEFINE_QUARK (peas-extension-type, extension_type)
+static GQuark quark_extension_type = 0;
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
@@ -181,7 +180,7 @@ peas_plugin_loader_lua_create_extension (PeasPluginLoader *loader,
/* We have to remember which interface we are instantiating
* for the deprecated peas_extension_get_extension_type().
*/
- g_object_set_qdata (object, extension_type_quark (),
+ g_object_set_qdata (object, quark_extension_type,
GSIZE_TO_POINTER (exten_type));
luaL_checkstack (L, 2, "");
@@ -374,6 +373,8 @@ peas_plugin_loader_lua_class_init (PeasPluginLoaderLuaClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
PeasPluginLoaderClass *loader_class = PEAS_PLUGIN_LOADER_CLASS (klass);
+ quark_extension_type = g_quark_from_static_string ("peas-extension-type");
+
object_class->finalize = peas_plugin_loader_lua_finalize;
loader_class->initialize = peas_plugin_loader_lua_initialize;