diff options
Diffstat (limited to 'gi/function.cpp')
-rw-r--r-- | gi/function.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gi/function.cpp b/gi/function.cpp index c9f8b1f3..e6672e05 100644 --- a/gi/function.cpp +++ b/gi/function.cpp @@ -679,6 +679,19 @@ bool GjsCallbackTrampoline::initialize() { g_assert(is_valid()); g_assert(!m_closure); + GITypeInfo return_type; + g_callable_info_load_return_type(m_info, &return_type); + GITypeTag return_tag = g_type_info_get_tag(&return_type); + if (g_callable_info_get_caller_owns(m_info) == GI_TRANSFER_NOTHING && + (return_tag == GI_TYPE_TAG_FILENAME || + return_tag == GI_TYPE_TAG_UTF8)) { + gjs_throw(context(), + "%s %s returns a transfer-none string. This is not supported " + "(https://gitlab.gnome.org/GNOME/gjs/-/issues/519)", + m_is_vfunc ? "VFunc" : "Callback", m_info.name()); + return false; + } + /* Analyze param types and directions, similarly to * init_cached_function_data */ int n_param_types = g_callable_info_get_n_args(m_info); |