Beispiel #1
0
func (m *EntryProxyerManager) destroy() {
	for _, entry := range m.Entries {
		dbus.UnInstallObject(entry)
	}
	dbus.UnInstallObject(m)
	if busdaemon != nil {
		pkgbus.DestroyDBusDaemon(busdaemon)
		busdaemon = nil
	}
}
Beispiel #2
0
func finalizeDBusIFC() {
	if dbusObj != nil {
		libdbus.DestroyDBusDaemon(dbusObj)
		dbusObj = nil
	}

	if mediaKeyObj != nil {
		libkeybind.DestroyMediaKey(mediaKeyObj)
		mediaKeyObj = nil
	}

	if loginObj != nil {
		liblogin1.DestroyManager(loginObj)
		loginObj = nil
	}
}
Beispiel #3
0
func isDBusSenderExist(sender string) bool {
	dbusDaemon, err := dbus.NewDBusDaemon("org.freedesktop.DBus", "/")
	if err != nil {
		logger.Error("Create freedesktop DBus failed:", err)
		return false
	}
	defer dbus.DestroyDBusDaemon(dbusDaemon)

	names, _ := dbusDaemon.ListNames()
	for _, name := range names {
		if name == sender {
			return true
		}
	}

	return false
}