diff options
Diffstat (limited to 'girepository/ginvoke.c')
-rw-r--r-- | girepository/ginvoke.c | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/girepository/ginvoke.c b/girepository/ginvoke.c index c9180d9f..d5182dbf 100644 --- a/girepository/ginvoke.c +++ b/girepository/ginvoke.c @@ -162,42 +162,18 @@ g_function_info_invoke (GIFunctionInfo *info, gint n_args, n_invoke_args, in_pos, out_pos, i; gpointer *args; gboolean success = FALSE; - + symbol = g_function_info_get_symbol (info); - if (!g_module_symbol (g_base_info_get_typelib((GIBaseInfo *) info)->module, - symbol, &func)) + if (!g_typelib_symbol (g_base_info_get_typelib((GIBaseInfo *) info), + symbol, &func)) { - GModule *entire_app; + g_set_error (error, + G_INVOKE_ERROR, + G_INVOKE_ERROR_SYMBOL_NOT_FOUND, + "Could not locate %s: %s", symbol, g_module_error ()); - /* - * We want to be able to add symbols to an app or an auxiliary - * library to fill in gaps in an introspected library. However, - * normally we would only look for symbols in the main library - * (typelib->module). - * - * A more elaborate solution is probably possible, but as a - * simple approach for now, if we fail to find a symbol we look - * for it in the global module. - * - * This would not be very efficient if it happened often, since - * we always do the failed lookup above first, but very few - * symbols should be outside of typelib->module so it doesn't - * matter. - */ - entire_app = g_module_open (NULL, 0); - if (!g_module_symbol (entire_app, symbol, &func)) - { - g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_SYMBOL_NOT_FOUND, - "Could not locate %s: %s", symbol, g_module_error ()); - - g_module_close (entire_app); - - return FALSE; - } - g_module_close (entire_app); + return FALSE; } is_method = (g_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD) != 0 |