You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some plugins are never safe to unload (e.g. if you're using Qt, Qt will start threads that are never joined and register thread-local variables in other threads, and it's unsafe to unload Qt code then). I'd like to use Boost.DLL for its portable API, but right now I need to use code like this to provoke an intentional leak:
shared_library follows the std::shared_ptr design. std::shared_ptr does not have a release() function.
Maybe the solution here should be different then. shared_ptr does allow one to customize the destructor, and you can even use a no-op closure here. What about something similar? Maybe load_mode::dont_unload?
Some plugins are never safe to unload (e.g. if you're using Qt, Qt will start threads that are never joined and register thread-local variables in other threads, and it's unsafe to unload Qt code then). I'd like to use Boost.DLL for its portable API, but right now I need to use code like this to provoke an intentional leak:
Here's code in the wild making use of this workaround: https://gitlab.com/emilua/qt6/-/blob/23baacf56b79d8355082df97bd1d0c2fa6c64ec1/src/qt_handle.cpp#L25
I'd rather do something like this:
dll::shared_library lib; // ... lib.release();
Can we have the release() function for shared_library?
The text was updated successfully, but these errors were encountered: