From: Francis Dupont Date: Tue, 24 Jan 2017 16:04:59 +0000 (+0100) Subject: [5095] Updated loadLibraries comment X-Git-Tag: trac3590_base~15^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b2aec7fee03e2f771f206d74617b209b3227206;p=thirdparty%2Fkea.git [5095] Updated loadLibraries comment --- diff --git a/src/lib/hooks/library_manager_collection.cc b/src/lib/hooks/library_manager_collection.cc index 0eb3f8ab1f..774770ed31 100644 --- a/src/lib/hooks/library_manager_collection.cc +++ b/src/lib/hooks/library_manager_collection.cc @@ -53,19 +53,28 @@ LibraryManagerCollection::loadLibraries() { // Unload libraries if any are loaded. static_cast(unloadLibraries()); - // Create the callout manager. A pointer to this is maintained by - // each library. Note that the callout manager does not hold any memory - // allocated by a library: although a library registers a callout (and so - // causes the creation of an entry in the CalloutManager's callout list), - // that creation is done by the CalloutManager itself. The CalloutManager - // is created within the server. + // Access the callout manager, (re)creating it if required. // - // The upshot of this is that it is therefore safe for the CalloutManager - // to be deleted after all associated libraries are deleted, hence this - // link (LibraryManager -> CalloutManager) is safe. + // A pointer to the callout manager is maintained by each each as well as by + // the HooksManager itself. Note that the callout manager does not hold any + // memory allocated by a library: although a library registers a callout + // (and so causes the creation of an entry in the CalloutManager's callout + // list), that creation is done by the CalloutManager itself. The + // CalloutManager is created within the server. The upshot of this is that + // it is therefore safe for the CalloutManager to be deleted after all + // associated libraries are deleted, hence this link (LibraryManager -> + // CalloutManager) is safe. // - // To survive reloads an attempt to re-use the shared manager - // is performed when the list of library names is empty. + // If the list of libraries is not empty, re-create the callout manager. + // This deletes all callouts (including the pre-library and post- + // library) ones. It is up to the libraries to re-register their callouts. + // The pre-library and post-library callouts will also need to be + // re-registered. + // + // If the list of libraries stays empty (as in the case of a reconfiguration + // where the hooks-libraries clause was empty and is not changed), try + // to re-use the existing callout manager (so retaining registered pre- + // and post-library callouts). if (library_names_.empty()) { callout_manager_ = HooksManager::getSharedCalloutManager(); }