forked from organicmaps/organicmaps
[platform] Use unique_ptr in CreateAppleLocationService
Signed-off-by: Ferenc Géczi <ferenc.gm@gmail.com>
This commit is contained in:
parent
c3708ac978
commit
5dc03fd52f
2 changed files with 6 additions and 4 deletions
|
@ -106,7 +106,7 @@ public:
|
|||
|
||||
@end
|
||||
|
||||
extern "C" location::LocationService * CreateAppleLocationService(LocationObserver & observer)
|
||||
std::unique_ptr<location::LocationService> CreateAppleLocationService(LocationObserver & observer)
|
||||
{
|
||||
return new AppleLocationService(observer);
|
||||
return std::make_unique<AppleLocationService>(observer);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
extern "C" location::LocationService * CreateAppleLocationService(location::LocationObserver &);
|
||||
#if defined(OMIM_OS_MAC)
|
||||
std::unique_ptr<location::LocationService> CreateAppleLocationService(location::LocationObserver &);
|
||||
#endif
|
||||
|
||||
namespace location
|
||||
{
|
||||
|
@ -70,7 +72,7 @@ public:
|
|||
: LocationService(observer), m_reportFirstEvent(true)
|
||||
{
|
||||
#if defined(OMIM_OS_MAC)
|
||||
m_services.push_back(std::unique_ptr<LocationService>(CreateAppleLocationService(*this)));
|
||||
m_services.push_back(CreateAppleLocationService(*this));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue