mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-25 03:36:32 +01:00
gutils: assert against calling g_set_application_name()
g_set_application_name() guards against being reset, but it doesn't
remember whether it was set, it only checks whether g_application_name
was set to non-NULL. When allowing g_set_application_name(NULL) that leads
to odd behaviors, like:
g_set_application_name(NULL);
g_set_application_name("foo");
would not warn.
Disallow that and assert against a NULL application_name.
Note that application_name argument is also not marked as "(nullable)".
This commit is contained in:
@@ -1232,7 +1232,9 @@ void
|
||||
g_set_application_name (const gchar *application_name)
|
||||
{
|
||||
gboolean already_set = FALSE;
|
||||
|
||||
|
||||
g_return_if_fail (application_name);
|
||||
|
||||
G_LOCK (g_application_name);
|
||||
if (g_application_name)
|
||||
already_set = TRUE;
|
||||
|
||||
Reference in New Issue
Block a user