mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-04-23 09:50:39 +02:00
up-polkit: remove global variable and remove g_object_add_weak_pointer()
Since UpPolkit is only created in the daemon, so the global variable and g_object_add_weak_pointer() can be removed.
This commit is contained in:
parent
88031e563f
commit
7db90b28d8
1 changed files with 1 additions and 8 deletions
|
|
@ -45,7 +45,6 @@ struct UpPolkitPrivate
|
|||
|
||||
G_DEFINE_TYPE_WITH_CODE (UpPolkit, up_polkit, G_TYPE_OBJECT,
|
||||
G_ADD_PRIVATE (UpPolkit))
|
||||
static gpointer up_polkit_object = NULL;
|
||||
|
||||
#ifdef HAVE_POLKIT
|
||||
/**
|
||||
|
|
@ -190,12 +189,6 @@ up_polkit_init (UpPolkit *polkit)
|
|||
UpPolkit *
|
||||
up_polkit_new (void)
|
||||
{
|
||||
if (up_polkit_object != NULL) {
|
||||
g_object_ref (up_polkit_object);
|
||||
} else {
|
||||
up_polkit_object = g_object_new (UP_TYPE_POLKIT, NULL);
|
||||
g_object_add_weak_pointer (up_polkit_object, &up_polkit_object);
|
||||
}
|
||||
return UP_POLKIT (up_polkit_object);
|
||||
return UP_POLKIT (g_object_new (UP_TYPE_POLKIT, NULL));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue