Mir

Code review comment for lp:~vanvugt/mir/fix-1527449

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

No, the problem of bug #1528135 is a bit more complex than that.

The destruction handling of UniqueModulePtr is not part of the platform library. The call to the destructor, and the unref of the library which is attached to the deleter happens at the owner of the ptr.

But of course you can annul the mechanic of make_module_ptr. Instead of making the code that loads the platform and creates instances from it the owner of the UniqueModuleptr(s).. you can stick it into a shared_ptr while you are still in the scope of the client platform. That will type erase the deleter handling, thus the shared_ptr deleter is now the owner.. and the code for it is generated inside the client platform...

To make proper use of UniqueModulePtr you need to use it as the return type of the factory functions that get dlsymed.

« Back to merge proposal