mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-06 23:20:34 +01:00
core: declare nm_firewall_manager_get() using NM_DEFINE_SINGLETON_GETTER()
This commit is contained in:
parent
f4bf50bf4a
commit
22409e0481
2 changed files with 1 additions and 18 deletions
|
|
@ -49,7 +49,6 @@
|
|||
#include "nm-dbus-manager.h"
|
||||
#include "nm-supplicant-manager.h"
|
||||
#include "nm-dhcp-manager.h"
|
||||
#include "nm-firewall-manager.h"
|
||||
#include "nm-logging.h"
|
||||
#include "nm-config.h"
|
||||
#include "nm-posix-signals.h"
|
||||
|
|
@ -203,7 +202,6 @@ main (int argc, char *argv[])
|
|||
NMManager *manager = NULL;
|
||||
gs_unref_object NMDBusManager *dbus_mgr = NULL;
|
||||
gs_unref_object NMSupplicantManager *sup_mgr = NULL;
|
||||
gs_unref_object NMFirewallManager *fw_mgr = NULL;
|
||||
gs_unref_object NMSettings *settings = NULL;
|
||||
gs_unref_object NMConfig *config = NULL;
|
||||
GError *error = NULL;
|
||||
|
|
@ -420,10 +418,6 @@ main (int argc, char *argv[])
|
|||
sup_mgr = nm_supplicant_manager_get ();
|
||||
g_assert (sup_mgr != NULL);
|
||||
|
||||
/* Initialize Firewall manager */
|
||||
fw_mgr = nm_firewall_manager_get ();
|
||||
g_assert (fw_mgr != NULL);
|
||||
|
||||
if (!nm_dbus_manager_get_connection (dbus_mgr)) {
|
||||
#if HAVE_DBUS_GLIB_100
|
||||
nm_log_warn (LOGD_CORE, "Failed to connect to D-Bus; only private bus is available");
|
||||
|
|
|
|||
|
|
@ -337,18 +337,7 @@ name_owner_changed (NMDBusManager *dbus_mgr,
|
|||
|
||||
/*******************************************************************/
|
||||
|
||||
NMFirewallManager *
|
||||
nm_firewall_manager_get (void)
|
||||
{
|
||||
static NMFirewallManager *singleton = NULL;
|
||||
|
||||
if (G_UNLIKELY (!singleton)) {
|
||||
singleton = NM_FIREWALL_MANAGER (g_object_new (NM_TYPE_FIREWALL_MANAGER, NULL));
|
||||
g_assert (singleton);
|
||||
}
|
||||
|
||||
return singleton;
|
||||
}
|
||||
NM_DEFINE_SINGLETON_GETTER (NMFirewallManager, nm_firewall_manager_get, NM_TYPE_FIREWALL_MANAGER);
|
||||
|
||||
static void
|
||||
nm_firewall_manager_init (NMFirewallManager * self)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue