mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-08 04:18:04 +02:00
lib: Initialise ->priv as soon as possible
If properties were to be set during construction, ->priv needs to not be a dangling/NULL pointer after the object initialization.
This commit is contained in:
parent
a1a437d7b1
commit
b75f0e2817
1 changed files with 1 additions and 1 deletions
|
|
@ -460,7 +460,6 @@ static gboolean
|
|||
up_client_initable_init (GInitable *initable, GCancellable *cancellable, GError **error)
|
||||
{
|
||||
UpClient *client = UP_CLIENT (initable);
|
||||
client->priv = up_client_get_instance_private (client);
|
||||
|
||||
/* connect to main interface */
|
||||
client->priv->proxy = up_exported_daemon_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
|
||||
|
|
@ -496,6 +495,7 @@ up_client_initable_iface_init (GInitableIface *iface)
|
|||
static void
|
||||
up_client_init (UpClient *client)
|
||||
{
|
||||
client->priv = up_client_get_instance_private (client);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue