Add g_type_ensure() and use it rather than playing games with volatile

https://bugzilla.gnome.org/show_bug.cgi?id=605976
This commit is contained in:
Dan Winship
2010-01-03 14:47:56 -05:00
parent 2a4235d0f3
commit e011d2c921
12 changed files with 72 additions and 55 deletions

View File

@@ -473,7 +473,6 @@ g_unix_connection_receive_credentials (GUnixConnection *connection,
gint nscm;
GSocket *socket;
gint n;
volatile GType credentials_message_gtype;
gssize num_bytes_read;
#ifdef __linux__
gboolean turn_off_so_passcreds;
@@ -543,9 +542,7 @@ g_unix_connection_receive_credentials (GUnixConnection *connection,
}
#endif
/* ensure the type of GUnixCredentialsMessage has been registered with the type system */
credentials_message_gtype = G_TYPE_UNIX_CREDENTIALS_MESSAGE;
(credentials_message_gtype); /* To avoid -Wunused-but-set-variable */
g_type_ensure (G_TYPE_UNIX_CREDENTIALS_MESSAGE);
num_bytes_read = g_socket_receive_message (socket,
NULL, /* GSocketAddress **address */
NULL,