mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-01 00:58:00 +02:00
core: declare nm_firewall_manager_get() using NM_DEFINE_SINGLETON_GETTER()
(cherry picked from commit 22409e0481)
This commit is contained in:
parent
53737e87e2
commit
cbe410e560
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-session-monitor.h"
|
||||
|
|
@ -292,7 +291,6 @@ main (int argc, char *argv[])
|
|||
gboolean success = FALSE;
|
||||
NMManager *manager = 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;
|
||||
gs_unref_object NMSessionMonitor *session_monitor = NULL;
|
||||
|
|
@ -498,10 +496,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);
|
||||
|
||||
/* Initialize session monitor */
|
||||
session_monitor = nm_session_monitor_get ();
|
||||
g_assert (session_monitor != NULL);
|
||||
|
|
|
|||
|
|
@ -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