Made the destructor of PluginManager to virtual, it's needed for generating js bindings.