core/dbus: minor refactoring not to clone the string tag
Since we already intenalize the @tag to a GQuark, just use the constant string, instead of duplicating the string. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
@@ -96,7 +96,7 @@ nm_dbus_manager_get (void)
|
|||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
|
||||||
struct _PrivateServer {
|
struct _PrivateServer {
|
||||||
char *tag;
|
const char *tag;
|
||||||
GQuark detail;
|
GQuark detail;
|
||||||
char *address;
|
char *address;
|
||||||
DBusServer *server;
|
DBusServer *server;
|
||||||
@@ -208,8 +208,8 @@ private_server_new (const char *path,
|
|||||||
(GDestroyNotify) private_server_dbus_connection_destroy,
|
(GDestroyNotify) private_server_dbus_connection_destroy,
|
||||||
g_free);
|
g_free);
|
||||||
s->manager = manager;
|
s->manager = manager;
|
||||||
s->tag = g_strdup (tag);
|
s->detail = g_quark_from_string (tag);
|
||||||
s->detail = g_quark_from_string (s->tag);
|
s->tag = g_quark_to_string (s->detail);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,6 @@ private_server_free (gpointer ptr)
|
|||||||
|
|
||||||
unlink (s->address);
|
unlink (s->address);
|
||||||
g_free (s->address);
|
g_free (s->address);
|
||||||
g_free (s->tag);
|
|
||||||
g_hash_table_destroy (s->connections);
|
g_hash_table_destroy (s->connections);
|
||||||
dbus_server_unref (s->server);
|
dbus_server_unref (s->server);
|
||||||
memset (s, 0, sizeof (*s));
|
memset (s, 0, sizeof (*s));
|
||||||
|
Reference in New Issue
Block a user