core: fix wrongly exporting object before instance is fully constructed
Exporting the object already in the *_init() function will later break because the object is not yet fully initialized at that point. Add a convenient flag so that the NMExportedObject parent implementation automatically can export itself. This saves the derived class from overwriting the constructed() method. Also add an assertion to catch such bugs.
This commit is contained in:
@@ -40,6 +40,7 @@ typedef struct {
|
||||
GObjectClass parent;
|
||||
|
||||
const char *export_path;
|
||||
char export_on_construction;
|
||||
} NMExportedObjectClass;
|
||||
|
||||
GType nm_exported_object_get_type (void);
|
||||
|
Reference in New Issue
Block a user