core: explicitly unexport objects when we're done with them
Previously most objects were implicitly unexported when they were destroyed, but since refcounts may make the object live longer than intended, we should explicitly unexport them when they should no longer be present on the bus. This means we can assume that objects will always be un-exported already when they are destroyed, *except* when quitting where most objects will live until exit because NM leaves interfaces up and running on quit.
This commit is contained in:

committed by
Thomas Haller

parent
d518278011
commit
f9ee20a7b2
@@ -45,6 +45,8 @@ typedef struct {
|
||||
|
||||
GType nm_exported_object_get_type (void);
|
||||
|
||||
void nm_exported_object_class_set_quitting (void);
|
||||
|
||||
void nm_exported_object_class_add_interface (NMExportedObjectClass *object_class,
|
||||
GType dbus_skeleton_type,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
@@ -56,6 +58,9 @@ void nm_exported_object_unexport (NMExportedObject *self);
|
||||
GSList * nm_exported_object_get_interfaces (NMExportedObject *self);
|
||||
GDBusInterfaceSkeleton *nm_exported_object_get_interface_by_type (NMExportedObject *self, GType interface_type);
|
||||
|
||||
void _nm_exported_object_clear_and_unexport (NMExportedObject **location);
|
||||
#define nm_exported_object_clear_and_unexport(location) _nm_exported_object_clear_and_unexport ((NMExportedObject **) (location))
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* NM_EXPORTED_OBJECT_H */
|
||||
|
Reference in New Issue
Block a user