In principle nothing is stopping some application from recreating devices or factories for no good reason. Ultimate solution will be to compile at build time, but we are not going for that at this moment. Next option is to keep those blobs global, and free them only on dll unload.
But either way this MR looks fine I think.