Re: [dll] Notifying a plugins host that a plugin should be unloaded
You cannot unload from the slot because (plugin signal) --- invokes ---> (slot). So the plugin is in use until the signal invocation has returned.
Therefore the slot must arrange for deferred unloading of the plugin. How can the deferred method know whether the signal invocation has completed? By using a semaphore, for example. The semaphore must be known to both the plugin and the
main application, and (in case of an unnamed semaphore) its address must physically reside in the main application’s address space.
It’s tricky and you should rather be asking yourself: “why bother”?