mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Fix warning when using g_irepository_enumerate_version()
The reason for the warning was that g_irepository_get_version() expects the typelib to be already loaded, but enumerate_version() can be called on typelibs that are not.
This commit is contained in:
parent
2b07f1ed31
commit
318843cead
@ -1196,9 +1196,12 @@ g_irepository_enumerate_versions (GIRepository *repository,
|
||||
* available versions, as it could have been loaded using
|
||||
* require_private().
|
||||
*/
|
||||
loaded_version = g_irepository_get_version (NULL, namespace_);
|
||||
if (loaded_version && !g_list_find_custom (ret, loaded_version, g_str_equal))
|
||||
ret = g_list_prepend (ret, g_strdup (loaded_version));
|
||||
if (g_irepository_is_registered (repository, namespace_, NULL))
|
||||
{
|
||||
loaded_version = g_irepository_get_version (repository, namespace_);
|
||||
if (loaded_version && !g_list_find_custom (ret, loaded_version, g_str_equal))
|
||||
ret = g_list_prepend (ret, g_strdup (loaded_version));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user