int HerePluginRequestUC(const char *provider, void *pCbFunc, void *user_data)
{
- if(!HereManager::GetHandler()->m_UserConsent)
- HereManager::GetHandler()->m_UserConsent = new (std::nothrow) HereUserConsent(provider, pCbFunc, user_data);
-
- if (HereManager::GetHandler()->m_UserConsent)
- return HereManager::GetHandler()->m_UserConsent->RequestUserConsent();
+ HereUserConsent *m_UserConsent = new (std::nothrow) HereUserConsent(provider, pCbFunc, user_data);
+ if (m_UserConsent)
+ return m_UserConsent->RequestUserConsent();
else
return HERE_ERROR_OUT_OF_MEMORY;
}
m_hConnection = NULL;
pthread_mutex_init(&m_mtxHereList, NULL);
pthread_mutex_init(&g_mtxRef, NULL);
-
- m_UserConsent = NULL;
}
HereManager::~HereManager()
{
- if (m_UserConsent) {
- delete m_UserConsent;
- m_UserConsent = NULL;
- }
if (m_hConnection)
{
connection_unset_type_changed_cb(m_hConnection);
if (!pUserConsent->m_pCbFunc) {
MAPS_LOGD("m_pCbFunc and is NULL");
+ delete pUserConsent;
return;
}
else
((maps_service_request_user_consent_with_handle_cb)pUserConsent->m_pCbFunc)((bool)enabled, pUserConsent->m_pUserData);
+ delete pUserConsent;
+
MAPS_FUNC_EXIT
}
if (agreed != TRUE) {
if (vconf_notify_key_changed(VCONFKEY_LOCATION_HEREMAPS_CONSENT, UserConsentChangedCb, this) < 0) {
MAPS_LOGD("Unable to register a vconf changed cb to VCONFKEY_LOCATION_HEREMAPS_CONSENT");
+ delete this;
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
}
isSetVconfCb = true;
((maps_service_request_user_consent_cb)m_pCbFunc)(TRUE, m_provider, m_pUserData);
else
((maps_service_request_user_consent_with_handle_cb)m_pCbFunc)(TRUE, m_pUserData);
+
+ delete this;
}
return HERE_ERROR_NONE;