diff --git a/ChangeLog b/ChangeLog index d78a94615..b0b952569 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-02-07 Emmanuele Bassi + + * clutter/clutter-script-parser.c: + (clutter_script_get_type_from_symbol), + (clutter_script_get_type_from_class): Use BIND_LAZY flag + when looking at the symbols, so we don't load them all up. + + * clutter/clutter-script.c (resolve_alpha_func): Ditto as above. + 2008-02-07 Øyvind Kolås * clutter/clutter-actor.c: diff --git a/clutter/clutter-script-parser.c b/clutter/clutter-script-parser.c index acf17eec8..977092516 100644 --- a/clutter/clutter-script-parser.c +++ b/clutter/clutter-script-parser.c @@ -26,7 +26,7 @@ clutter_script_get_type_from_symbol (const gchar *symbol) GType gtype = G_TYPE_INVALID; if (!module) - module = g_module_open (NULL, 0); + module = g_module_open (NULL, G_MODULE_BIND_LAZY); if (g_module_symbol (module, symbol, (gpointer)&func)) gtype = func (); @@ -64,7 +64,10 @@ clutter_script_get_type_from_class (const gchar *name) symbol = g_string_free (symbol_name, FALSE); if (g_module_symbol (module, symbol, (gpointer)&func)) - gtype = func (); + { + CLUTTER_NOTE (SCRIPT, "Type function: %s", symbol); + gtype = func (); + } g_free (symbol); diff --git a/clutter/clutter-script.c b/clutter/clutter-script.c index 2acbf7414..c25f19514 100644 --- a/clutter/clutter-script.c +++ b/clutter/clutter-script.c @@ -506,12 +506,13 @@ resolve_alpha_func (const gchar *name) gint i; if (G_UNLIKELY (!module)) - module = g_module_open (NULL, 0); + module = g_module_open (NULL, G_MODULE_BIND_LAZY); - CLUTTER_NOTE (SCRIPT, "Looking for `%s' alpha function", name); - if (g_module_symbol (module, name, (gpointer) &func)) - return func; + { + CLUTTER_NOTE (SCRIPT, "Found `%s' alpha function", name); + return func; + } symbol_name = g_string_new (""); g_string_append (symbol_name, "clutter_"); @@ -528,12 +529,16 @@ resolve_alpha_func (const gchar *name) symbol = g_string_free (symbol_name, FALSE); - if (!g_module_symbol (module, symbol, (gpointer)&func)) - func = NULL; + if (g_module_symbol (module, symbol, (gpointer)&func)) + { + CLUTTER_NOTE (SCRIPT, "Found `%s' alpha function", symbol); + g_free (symbol); + return func; + } g_free (symbol); - return func; + return NULL; } GObject *