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.
Showing with 33 additions and 4 deletions