mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Make the Server
keep a shared_ptr
instead of a raw NameMapper pointer.
Same as for `Library`, we want to be sure that the `NameMapper` actually exists when the server is using it.
This commit is contained in:
@ -36,7 +36,7 @@ namespace kiwix
|
||||
*
|
||||
* @param library The library to serve.
|
||||
*/
|
||||
Server(std::shared_ptr<Library> library, NameMapper* nameMapper=nullptr);
|
||||
Server(std::shared_ptr<Library> library, std::shared_ptr<NameMapper> nameMapper=nullptr);
|
||||
|
||||
virtual ~Server();
|
||||
|
||||
@ -67,7 +67,7 @@ namespace kiwix
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Library> mp_library;
|
||||
NameMapper* mp_nameMapper;
|
||||
std::shared_ptr<NameMapper> mp_nameMapper;
|
||||
std::string m_root = "";
|
||||
std::string m_addr = "";
|
||||
std::string m_indexTemplateString = "";
|
||||
|
Reference in New Issue
Block a user