|
@@ -53,19 +53,28 @@ LibraryManagerCollection::loadLibraries() {
|
|
|
// Unload libraries if any are loaded.
|
|
|
static_cast<void>(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();
|
|
|
}
|