fix memory leak.
define copy constructor.
catch exception at destructor.
Change-Id: I52ed517449603b58f0fc04619e02757e67abf55d
Signed-off-by: jyong2.kim <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5163
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
DevicePresence();
~DevicePresence();
+ DevicePresence(DevicePresence &&) = delete;
+ DevicePresence(const DevicePresence &) = delete;
+
+ DevicePresence & operator = (DevicePresence &&) = delete;
+ DevicePresence & operator = (const DevicePresence &) = delete;
+
void initializeDevicePresence(PrimitiveResourcePtr pResource);
void addPresenceResource(ResourcePresence * rPresence);
if(presenceSubscriber.isSubscribing())
{
OIC_LOG_V(DEBUG,BROKER_TAG,"unsubscribed presence.");
- presenceSubscriber.unsubscribe();
+ try
+ {
+ presenceSubscriber.unsubscribe();
+ } catch (std::exception & e)
+ {
+ OIC_LOG_V(DEBUG,BROKER_TAG,"unsubscribed presence : %s", e.what());
+ }
}
resourcePresenceList.clear();
OIC_LOG_V(DEBUG,BROKER_TAG,"destroy Timer.");
{
OIC_LOG_V(DEBUG, BROKER_TAG, "clear the brokerIDMap.");
s_brokerIDMap->erase(s_brokerIDMap->begin(), s_brokerIDMap->end());
- s_brokerIDMap->clear();
}
}
DataCache();
~DataCache();
+ DataCache(const DataCache &) = default;
+ DataCache(DataCache &&) = default;
+ DataCache & operator = (const DataCache &) = default;
+ DataCache & operator = (DataCache &&) = default;
+
void initializeDataCache(PrimitiveResourcePtr pResource);
CacheID addSubscriber(CacheCB func, REPORT_FREQUENCY rf, long repeatTime);