mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-10-31 16:32:18 +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:
		| @@ -1233,6 +1233,8 @@ g_set_application_name (const gchar *application_name) | |||||||
| { | { | ||||||
|   gboolean already_set = FALSE; |   gboolean already_set = FALSE; | ||||||
|  |  | ||||||
|  |   g_return_if_fail (application_name); | ||||||
|  |  | ||||||
|   G_LOCK (g_application_name); |   G_LOCK (g_application_name); | ||||||
|   if (g_application_name) |   if (g_application_name) | ||||||
|     already_set = TRUE; |     already_set = TRUE; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user