mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-20 08:31:47 +00:00
core: convert the DBus manager to a single-ref object
It's created very, very early and never needs to be unrefed by anything except the main() function.
This commit is contained in:
parent
e3bd3278e9
commit
04cb58eacd
|
@ -229,7 +229,6 @@ nm_bluez_adapter_new (const char *path, NMConnectionProvider *provider)
|
|||
{
|
||||
NMBluezAdapter *self;
|
||||
NMBluezAdapterPrivate *priv;
|
||||
NMDBusManager *dbus_mgr;
|
||||
DBusGConnection *connection;
|
||||
|
||||
self = (NMBluezAdapter *) g_object_new (NM_TYPE_BLUEZ_ADAPTER,
|
||||
|
@ -242,14 +241,12 @@ nm_bluez_adapter_new (const char *path, NMConnectionProvider *provider)
|
|||
|
||||
priv->provider = provider;
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
connection = nm_dbus_manager_get_connection (dbus_mgr);
|
||||
connection = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
|
||||
|
||||
priv->proxy = dbus_g_proxy_new_for_name (connection,
|
||||
BLUEZ_SERVICE,
|
||||
priv->path,
|
||||
BLUEZ_ADAPTER_INTERFACE);
|
||||
g_object_unref (dbus_mgr);
|
||||
|
||||
dbus_g_proxy_add_signal (priv->proxy, "DeviceCreated",
|
||||
DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
|
||||
|
|
|
@ -378,7 +378,6 @@ nm_bluez_device_new (const char *path, NMConnectionProvider *provider)
|
|||
{
|
||||
NMBluezDevice *self;
|
||||
NMBluezDevicePrivate *priv;
|
||||
NMDBusManager *dbus_mgr;
|
||||
DBusGConnection *connection;
|
||||
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
|
@ -414,14 +413,12 @@ nm_bluez_device_new (const char *path, NMConnectionProvider *provider)
|
|||
G_CALLBACK (cp_connections_loaded),
|
||||
self);
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
connection = nm_dbus_manager_get_connection (dbus_mgr);
|
||||
connection = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
|
||||
|
||||
priv->proxy = dbus_g_proxy_new_for_name (connection,
|
||||
BLUEZ_SERVICE,
|
||||
priv->path,
|
||||
BLUEZ_DEVICE_INTERFACE);
|
||||
g_object_unref (dbus_mgr);
|
||||
|
||||
dbus_g_object_register_marshaller (g_cclosure_marshal_generic,
|
||||
G_TYPE_NONE,
|
||||
|
|
|
@ -347,7 +347,7 @@ dispose (GObject *object)
|
|||
if (priv->dbus_mgr) {
|
||||
g_signal_handlers_disconnect_by_func (priv->dbus_mgr, name_owner_changed_cb, self);
|
||||
g_signal_handlers_disconnect_by_func (priv->dbus_mgr, dbus_connection_changed_cb, self);
|
||||
g_object_unref (priv->dbus_mgr);
|
||||
priv->dbus_mgr = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (nm_bluez_manager_parent_class)->dispose (object);
|
||||
|
|
|
@ -1235,7 +1235,7 @@ dispose (GObject *object)
|
|||
g_signal_handler_disconnect (priv->dbus_mgr, priv->mm_watch_id);
|
||||
priv->mm_watch_id = 0;
|
||||
}
|
||||
g_clear_object (&priv->dbus_mgr);
|
||||
priv->dbus_mgr = NULL;
|
||||
|
||||
g_clear_object (&priv->type_proxy);
|
||||
g_clear_object (&priv->dev_proxy);
|
||||
|
|
|
@ -95,7 +95,6 @@ void
|
|||
nm_wimax_nsp_export_to_dbus (NMWimaxNsp *self)
|
||||
{
|
||||
NMWimaxNspPrivate *priv;
|
||||
NMDBusManager *mgr;
|
||||
static guint32 counter = 0;
|
||||
|
||||
g_return_if_fail (NM_IS_WIMAX_NSP (self));
|
||||
|
@ -104,10 +103,8 @@ nm_wimax_nsp_export_to_dbus (NMWimaxNsp *self)
|
|||
|
||||
g_return_if_fail (priv->dbus_path == NULL);
|
||||
|
||||
mgr = nm_dbus_manager_get ();
|
||||
priv->dbus_path = g_strdup_printf (NM_DBUS_PATH_WIMAX_NSP "/%d", counter++);
|
||||
nm_dbus_manager_register_object (mgr, priv->dbus_path, self);
|
||||
g_object_unref (mgr);
|
||||
nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->dbus_path, self);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
|
@ -687,7 +687,6 @@ dispose (GObject *object)
|
|||
g_signal_handler_disconnect (priv->dbus_mgr, priv->dis_conn_id);
|
||||
priv->dis_conn_id = 0;
|
||||
}
|
||||
g_object_unref (priv->dbus_mgr);
|
||||
priv->dbus_mgr = NULL;
|
||||
|
||||
if (priv->proxies) {
|
||||
|
|
|
@ -284,7 +284,7 @@ dispose (GObject *object)
|
|||
if (priv->dbus_mgr) {
|
||||
if (priv->name_owner_id)
|
||||
g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id);
|
||||
g_object_unref (G_OBJECT (priv->dbus_mgr));
|
||||
priv->dbus_mgr = NULL;
|
||||
}
|
||||
|
||||
if (priv->proxy)
|
||||
|
|
|
@ -37,7 +37,6 @@ G_DEFINE_TYPE (NMModemGeneric, nm_modem_generic, NM_TYPE_MODEM)
|
|||
#define NM_MODEM_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_GENERIC, NMModemGenericPrivate))
|
||||
|
||||
typedef struct {
|
||||
NMDBusManager *dbus_mgr;
|
||||
DBusGProxy *proxy;
|
||||
DBusGProxy *props_proxy;
|
||||
|
||||
|
@ -354,9 +353,6 @@ modem_properties_changed (DBusGProxy *proxy,
|
|||
static void
|
||||
nm_modem_generic_init (NMModemGeneric *self)
|
||||
{
|
||||
NMModemGenericPrivate *priv = NM_MODEM_GENERIC_GET_PRIVATE (self);
|
||||
|
||||
priv->dbus_mgr = nm_dbus_manager_get ();
|
||||
}
|
||||
|
||||
static GObject*
|
||||
|
@ -374,7 +370,7 @@ constructor (GType type,
|
|||
|
||||
priv = NM_MODEM_GENERIC_GET_PRIVATE (object);
|
||||
|
||||
bus = nm_dbus_manager_get_connection (priv->dbus_mgr);
|
||||
bus = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
|
||||
priv->proxy = dbus_g_proxy_new_for_name (bus,
|
||||
MM_OLD_DBUS_SERVICE,
|
||||
nm_modem_get_path (NM_MODEM (object)),
|
||||
|
@ -416,11 +412,6 @@ dispose (GObject *object)
|
|||
priv->props_proxy = NULL;
|
||||
}
|
||||
|
||||
if (priv->dbus_mgr) {
|
||||
g_object_unref (priv->dbus_mgr);
|
||||
priv->dbus_mgr = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (nm_modem_generic_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
|
|
@ -802,10 +802,7 @@ dispose (GObject *object)
|
|||
g_hash_table_destroy (self->priv->modems);
|
||||
}
|
||||
|
||||
if (self->priv->dbus_mgr) {
|
||||
g_object_unref (self->priv->dbus_mgr);
|
||||
self->priv->dbus_mgr = NULL;
|
||||
}
|
||||
self->priv->dbus_mgr = NULL;
|
||||
|
||||
/* Chain up to the parent class */
|
||||
G_OBJECT_CLASS (nm_modem_manager_parent_class)->dispose (object);
|
||||
|
|
|
@ -212,13 +212,10 @@ void
|
|||
nm_active_connection_export (NMActiveConnection *self)
|
||||
{
|
||||
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (self);
|
||||
NMDBusManager *dbus_mgr;
|
||||
static guint32 counter = 0;
|
||||
|
||||
priv->path = g_strdup_printf (NM_DBUS_PATH "/ActiveConnection/%d", counter++);
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
nm_dbus_manager_register_object (dbus_mgr, priv->path, self);
|
||||
g_object_unref (dbus_mgr);
|
||||
nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->path, self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
|
@ -79,16 +79,15 @@ NMDBusManager *
|
|||
nm_dbus_manager_get (void)
|
||||
{
|
||||
static NMDBusManager *singleton = NULL;
|
||||
static gsize once = 0;
|
||||
|
||||
if (!singleton) {
|
||||
singleton = NM_DBUS_MANAGER (g_object_new (NM_TYPE_DBUS_MANAGER, NULL));
|
||||
if (g_once_init_enter (&once)) {
|
||||
singleton = (NMDBusManager *) g_object_new (NM_TYPE_DBUS_MANAGER, NULL);
|
||||
g_assert (singleton);
|
||||
if (!nm_dbus_manager_init_bus (singleton))
|
||||
start_reconnection_timeout (singleton);
|
||||
} else {
|
||||
g_object_ref (singleton);
|
||||
g_once_init_leave (&once, 1);
|
||||
}
|
||||
|
||||
g_assert (singleton);
|
||||
return singleton;
|
||||
}
|
||||
|
||||
|
|
|
@ -140,12 +140,9 @@ nm_dhcp4_config_init (NMDHCP4Config *self)
|
|||
{
|
||||
NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (self);
|
||||
static guint32 counter = 0;
|
||||
NMDBusManager *dbus_mgr;
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/DHCP4Config/%d", counter++);
|
||||
nm_dbus_manager_register_object (dbus_mgr, priv->dbus_path, self);
|
||||
g_object_unref (dbus_mgr);
|
||||
nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->dbus_path, self);
|
||||
|
||||
priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nm_gvalue_destroy);
|
||||
}
|
||||
|
|
|
@ -140,12 +140,9 @@ nm_dhcp6_config_init (NMDHCP6Config *self)
|
|||
{
|
||||
NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (self);
|
||||
static guint32 counter = 0;
|
||||
NMDBusManager *dbus_mgr;
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/DHCP6Config/%d", counter++);
|
||||
nm_dbus_manager_register_object (dbus_mgr, priv->dbus_path, self);
|
||||
g_object_unref (dbus_mgr);
|
||||
nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->dbus_path, self);
|
||||
|
||||
priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nm_gvalue_destroy);
|
||||
}
|
||||
|
|
|
@ -134,14 +134,12 @@ fill_vpn_props (NMIP4Config *ip4_config,
|
|||
typedef struct {
|
||||
DispatcherFunc callback;
|
||||
gpointer user_data;
|
||||
NMDBusManager *dbus_mgr;
|
||||
} DispatchInfo;
|
||||
|
||||
static void
|
||||
dispatcher_info_free (DispatchInfo *info)
|
||||
{
|
||||
requests = g_slist_remove (requests, info);
|
||||
g_object_unref (info->dbus_mgr);
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
|
@ -273,7 +271,6 @@ _dispatcher_call (DispatcherAction action,
|
|||
DispatcherFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDBusManager *dbus_mgr;
|
||||
DBusGProxy *proxy;
|
||||
DBusGConnection *g_connection;
|
||||
GHashTable *connection_hash;
|
||||
|
@ -295,15 +292,13 @@ _dispatcher_call (DispatcherAction action,
|
|||
if (action == DISPATCHER_ACTION_VPN_UP)
|
||||
g_return_val_if_fail (vpn_ip4_config != NULL, NULL);
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
g_connection = nm_dbus_manager_get_connection (dbus_mgr);
|
||||
g_connection = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
|
||||
proxy = dbus_g_proxy_new_for_name (g_connection,
|
||||
NM_DISPATCHER_DBUS_SERVICE,
|
||||
NM_DISPATCHER_DBUS_PATH,
|
||||
NM_DISPATCHER_DBUS_IFACE);
|
||||
if (!proxy) {
|
||||
nm_log_err (LOGD_CORE, "could not get dispatcher proxy!");
|
||||
g_object_unref (dbus_mgr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -342,7 +337,6 @@ _dispatcher_call (DispatcherAction action,
|
|||
info = g_malloc0 (sizeof (*info));
|
||||
info->callback = callback;
|
||||
info->user_data = user_data;
|
||||
info->dbus_mgr = dbus_mgr;
|
||||
|
||||
/* Send the action to the dispatcher */
|
||||
call = dbus_g_proxy_begin_call_with_timeout (proxy, "Action",
|
||||
|
|
|
@ -145,7 +145,6 @@ void
|
|||
nm_ip4_config_export (NMIP4Config *config)
|
||||
{
|
||||
NMIP4ConfigPrivate *priv;
|
||||
NMDBusManager *dbus_mgr;
|
||||
static guint32 counter = 0;
|
||||
|
||||
g_return_if_fail (NM_IS_IP4_CONFIG (config));
|
||||
|
@ -153,10 +152,8 @@ nm_ip4_config_export (NMIP4Config *config)
|
|||
priv = NM_IP4_CONFIG_GET_PRIVATE (config);
|
||||
g_return_if_fail (priv->path == NULL);
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
priv->path = g_strdup_printf (NM_DBUS_PATH "/IP4Config/%d", counter++);
|
||||
nm_dbus_manager_register_object (dbus_mgr, priv->path, config);
|
||||
g_object_unref (dbus_mgr);
|
||||
nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->path, config);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
|
@ -142,7 +142,6 @@ void
|
|||
nm_ip6_config_export (NMIP6Config *config)
|
||||
{
|
||||
NMIP6ConfigPrivate *priv;
|
||||
NMDBusManager *dbus_mgr;
|
||||
static guint32 counter = 0;
|
||||
|
||||
g_return_if_fail (NM_IS_IP6_CONFIG (config));
|
||||
|
@ -150,10 +149,8 @@ nm_ip6_config_export (NMIP6Config *config)
|
|||
priv = NM_IP6_CONFIG_GET_PRIVATE (config);
|
||||
g_return_if_fail (priv->path == NULL);
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
priv->path = g_strdup_printf (NM_DBUS_PATH "/IP6Config/%d", counter++);
|
||||
nm_dbus_manager_register_object (dbus_mgr, priv->path, config);
|
||||
g_object_unref (dbus_mgr);
|
||||
nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->path, config);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
|
@ -150,15 +150,11 @@ nm_auth_chain_new (DBusGMethodInvocation *context,
|
|||
{
|
||||
gulong sender_uid = G_MAXULONG;
|
||||
char *sender = NULL;
|
||||
NMDBusManager *dbus_mgr;
|
||||
NMAuthChain *chain = NULL;
|
||||
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
g_assert (dbus_mgr);
|
||||
|
||||
if (nm_dbus_manager_get_caller_info (dbus_mgr,
|
||||
if (nm_dbus_manager_get_caller_info (nm_dbus_manager_get (),
|
||||
context,
|
||||
&sender,
|
||||
&sender_uid)) {
|
||||
|
@ -169,7 +165,6 @@ nm_auth_chain_new (DBusGMethodInvocation *context,
|
|||
*out_error_desc = "Unable to determine request UID and sender.";
|
||||
|
||||
g_free (sender);
|
||||
g_object_unref (dbus_mgr);
|
||||
return chain;
|
||||
}
|
||||
|
||||
|
|
|
@ -4150,7 +4150,7 @@ dispose (GObject *object)
|
|||
dbus_connection_remove_filter (dbus_connection, prop_filter, manager);
|
||||
}
|
||||
g_signal_handler_disconnect (priv->dbus_mgr, priv->dbus_connection_changed_id);
|
||||
g_object_unref (priv->dbus_mgr);
|
||||
priv->dbus_mgr = NULL;
|
||||
|
||||
if (priv->bluez_mgr)
|
||||
g_object_unref (priv->bluez_mgr);
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dbus/dbus-glib-lowlevel.h>
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <gio/gio.h>
|
||||
#include "nm-logging.h"
|
||||
|
@ -73,11 +72,9 @@ upower_resuming_cb (DBusGProxy *proxy, gpointer user_data)
|
|||
static void
|
||||
nm_sleep_monitor_init (NMSleepMonitor *self)
|
||||
{
|
||||
NMDBusManager *dbus_mgr;
|
||||
DBusGConnection *bus;
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
bus = nm_dbus_manager_get_connection (dbus_mgr);
|
||||
bus = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
|
||||
self->upower_proxy = dbus_g_proxy_new_for_name (bus,
|
||||
UPOWER_DBUS_SERVICE,
|
||||
"/org/freedesktop/UPower",
|
||||
|
@ -94,7 +91,6 @@ nm_sleep_monitor_init (NMSleepMonitor *self)
|
|||
self, NULL);
|
||||
} else
|
||||
nm_log_warn (LOGD_SUSPEND, "could not initialize UPower D-Bus proxy");
|
||||
g_object_unref (dbus_mgr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -317,7 +317,6 @@ void
|
|||
nm_ap_export_to_dbus (NMAccessPoint *ap)
|
||||
{
|
||||
NMAccessPointPrivate *priv;
|
||||
NMDBusManager *mgr;
|
||||
static guint32 counter = 0;
|
||||
|
||||
g_return_if_fail (NM_IS_AP (ap));
|
||||
|
@ -329,10 +328,8 @@ nm_ap_export_to_dbus (NMAccessPoint *ap)
|
|||
return;
|
||||
}
|
||||
|
||||
mgr = nm_dbus_manager_get ();
|
||||
priv->dbus_path = g_strdup_printf (NM_DBUS_PATH_ACCESS_POINT "/%d", counter++);
|
||||
nm_dbus_manager_register_object (mgr, priv->dbus_path, ap);
|
||||
g_object_unref (mgr);
|
||||
nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->dbus_path, ap);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -76,7 +76,6 @@ typedef struct {
|
|||
gboolean disposed;
|
||||
|
||||
GPid pid;
|
||||
NMDBusManager *dbus_manager;
|
||||
char *dbus_path;
|
||||
|
||||
char *parent_iface;
|
||||
|
@ -147,20 +146,12 @@ constructor (GType type,
|
|||
object = G_OBJECT_CLASS (nm_ppp_manager_parent_class)->constructor (type,
|
||||
n_construct_params,
|
||||
construct_params);
|
||||
if (!object)
|
||||
return NULL;
|
||||
|
||||
priv = NM_PPP_MANAGER_GET_PRIVATE (object);
|
||||
priv->dbus_manager = nm_dbus_manager_get ();
|
||||
if (!priv->dbus_manager) {
|
||||
g_object_unref (object);
|
||||
return NULL;
|
||||
if (object) {
|
||||
priv = NM_PPP_MANAGER_GET_PRIVATE (object);
|
||||
priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/PPP/%d", counter++);
|
||||
connection = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
|
||||
dbus_g_connection_register_g_object (connection, priv->dbus_path, object);
|
||||
}
|
||||
|
||||
connection = nm_dbus_manager_get_connection (priv->dbus_manager);
|
||||
priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/PPP/%d", counter++);
|
||||
dbus_g_connection_register_g_object (connection, priv->dbus_path, object);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
|
@ -178,9 +169,6 @@ dispose (GObject *object)
|
|||
g_object_unref (priv->act_req);
|
||||
priv->act_req = NULL;
|
||||
}
|
||||
|
||||
g_object_unref (priv->dbus_manager);
|
||||
priv->dbus_manager = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (nm_ppp_manager_parent_class)->dispose (object);
|
||||
|
|
|
@ -1477,7 +1477,7 @@ dispose (GObject *object)
|
|||
g_hash_table_destroy (priv->requests);
|
||||
|
||||
g_object_unref (priv->session_monitor);
|
||||
g_object_unref (priv->dbus_mgr);
|
||||
priv->dbus_mgr = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (nm_agent_manager_parent_class)->dispose (object);
|
||||
|
|
|
@ -426,7 +426,6 @@ nm_secret_agent_new (DBusGMethodInvocation *context,
|
|||
{
|
||||
NMSecretAgent *self;
|
||||
NMSecretAgentPrivate *priv;
|
||||
NMDBusManager *dbus_mgr;
|
||||
char *hash_str, *username;
|
||||
struct passwd *pw;
|
||||
|
||||
|
@ -450,14 +449,12 @@ nm_secret_agent_new (DBusGMethodInvocation *context,
|
|||
priv->hash = g_str_hash (hash_str);
|
||||
g_free (hash_str);
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
priv->proxy = nm_dbus_manager_new_proxy (dbus_mgr,
|
||||
priv->proxy = nm_dbus_manager_new_proxy (nm_dbus_manager_get (),
|
||||
context,
|
||||
owner,
|
||||
NM_DBUS_PATH_SECRET_AGENT,
|
||||
NM_DBUS_INTERFACE_SECRET_AGENT);
|
||||
g_assert (priv->proxy);
|
||||
g_object_unref (dbus_mgr);
|
||||
|
||||
g_free (username);
|
||||
return self;
|
||||
|
|
|
@ -82,7 +82,6 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
|||
typedef struct {
|
||||
gboolean disposed;
|
||||
|
||||
NMDBusManager *dbus_mgr;
|
||||
NMAgentManager *agent_mgr;
|
||||
NMSessionMonitor *session_monitor;
|
||||
guint session_changed_id;
|
||||
|
@ -919,7 +918,6 @@ pk_auth_cb (NMAuthChain *chain,
|
|||
static gboolean
|
||||
check_user_in_acl (NMConnection *connection,
|
||||
DBusGMethodInvocation *context,
|
||||
NMDBusManager *dbus_mgr,
|
||||
NMSessionMonitor *session_monitor,
|
||||
gulong *out_sender_uid,
|
||||
GError **error)
|
||||
|
@ -932,7 +930,7 @@ check_user_in_acl (NMConnection *connection,
|
|||
g_return_val_if_fail (session_monitor != NULL, FALSE);
|
||||
|
||||
/* Get the caller's UID */
|
||||
if (!nm_dbus_manager_get_caller_info (dbus_mgr, context, NULL, &sender_uid)) {
|
||||
if (!nm_dbus_manager_get_caller_info (nm_dbus_manager_get (), context, NULL, &sender_uid)) {
|
||||
g_set_error_literal (error,
|
||||
NM_SETTINGS_ERROR,
|
||||
NM_SETTINGS_ERROR_PERMISSION_DENIED,
|
||||
|
@ -970,7 +968,6 @@ auth_start (NMSettingsConnection *self,
|
|||
|
||||
if (!check_user_in_acl (NM_CONNECTION (self),
|
||||
context,
|
||||
priv->dbus_mgr,
|
||||
priv->session_monitor,
|
||||
&sender_uid,
|
||||
&error)) {
|
||||
|
@ -1230,7 +1227,6 @@ impl_settings_connection_update (NMSettingsConnection *self,
|
|||
*/
|
||||
if (!check_user_in_acl (tmp,
|
||||
context,
|
||||
priv->dbus_mgr,
|
||||
priv->session_monitor,
|
||||
NULL,
|
||||
&error)) {
|
||||
|
@ -1721,8 +1717,6 @@ nm_settings_connection_init (NMSettingsConnection *self)
|
|||
{
|
||||
NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self);
|
||||
|
||||
priv->dbus_mgr = nm_dbus_manager_get ();
|
||||
|
||||
priv->visible = FALSE;
|
||||
|
||||
priv->session_monitor = nm_session_monitor_get ();
|
||||
|
@ -1773,7 +1767,6 @@ dispose (GObject *object)
|
|||
g_signal_handler_disconnect (priv->session_monitor, priv->session_changed_id);
|
||||
g_object_unref (priv->session_monitor);
|
||||
g_object_unref (priv->agent_mgr);
|
||||
g_object_unref (priv->dbus_mgr);
|
||||
|
||||
out:
|
||||
G_OBJECT_CLASS (nm_settings_connection_parent_class)->dispose (object);
|
||||
|
|
|
@ -1650,7 +1650,7 @@ dispose (GObject *object)
|
|||
nm_auth_chain_unref ((NMAuthChain *) iter->data);
|
||||
g_slist_free (priv->auths);
|
||||
|
||||
g_object_unref (priv->dbus_mgr);
|
||||
priv->dbus_mgr = NULL;
|
||||
|
||||
g_object_unref (priv->session_monitor);
|
||||
g_object_unref (priv->agent_mgr);
|
||||
|
|
|
@ -1595,8 +1595,7 @@ dispose (GObject *object)
|
|||
|
||||
g_free (priv->dev);
|
||||
|
||||
if (priv->dbus_mgr)
|
||||
g_object_unref (priv->dbus_mgr);
|
||||
priv->dbus_mgr = NULL;
|
||||
|
||||
if (priv->cfg)
|
||||
g_object_unref (priv->cfg);
|
||||
|
|
|
@ -378,7 +378,7 @@ dispose (GObject *object)
|
|||
if (priv->dbus_mgr) {
|
||||
if (priv->name_owner_id)
|
||||
g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id);
|
||||
g_object_unref (G_OBJECT (priv->dbus_mgr));
|
||||
priv->dbus_mgr = NULL;
|
||||
}
|
||||
|
||||
g_hash_table_destroy (priv->ifaces);
|
||||
|
|
|
@ -1175,19 +1175,18 @@ void
|
|||
nm_vpn_connection_activate (NMVPNConnection *connection)
|
||||
{
|
||||
NMVPNConnectionPrivate *priv;
|
||||
NMDBusManager *dbus_mgr;
|
||||
DBusGConnection *bus;
|
||||
|
||||
g_return_if_fail (NM_IS_VPN_CONNECTION (connection));
|
||||
g_return_if_fail (nm_vpn_connection_get_vpn_state (connection) == NM_VPN_CONNECTION_STATE_PREPARE);
|
||||
|
||||
priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
|
||||
|
||||
dbus_mgr = nm_dbus_manager_get ();
|
||||
priv->proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (dbus_mgr),
|
||||
bus = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
|
||||
priv->proxy = dbus_g_proxy_new_for_name (bus,
|
||||
nm_vpn_connection_get_service (connection),
|
||||
NM_VPN_DBUS_PLUGIN_PATH,
|
||||
NM_VPN_DBUS_PLUGIN_INTERFACE);
|
||||
g_object_unref (dbus_mgr);
|
||||
|
||||
dbus_g_proxy_add_signal (priv->proxy, "Failure", G_TYPE_UINT, G_TYPE_INVALID);
|
||||
dbus_g_proxy_connect_signal (priv->proxy, "Failure",
|
||||
|
|
|
@ -450,7 +450,7 @@ dispose (GObject *object)
|
|||
clear_quit_timeout (self);
|
||||
service_quit (self);
|
||||
|
||||
g_object_unref (priv->dbus_mgr);
|
||||
priv->dbus_mgr = NULL;
|
||||
|
||||
g_free (priv->name);
|
||||
g_free (priv->dbus_service);
|
||||
|
|
Loading…
Reference in a new issue