Fix a callback problem of PrimitiveResource
authorcoderhyme <jhyo.kim@samsung.com>
Tue, 28 Jul 2015 05:29:18 +0000 (14:29 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Tue, 28 Jul 2015 11:50:39 +0000 (11:50 +0000)
commit957bb6b53e9cb60dbfb49b7c37f5a364afb3a5e5
treeee0b1857340435b1bf7896448bcfd80ec802bf30
parent4047a3941b3ead406755add2671282ee5ba0e2a1
Fix a callback problem of PrimitiveResource

The problem was calling the callback even after the object for it was gone.
PrimitiveResource is only created with shared_ptr and callbacks are async operations.
When received the response, there is a possibility that no one holds the resource.

Now checks the object is alive before executing the callback.

Change-Id: I07b20d251c2b8544e7d27f354193b53c910d579c
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1950
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/resource-encapsulation/src/common/primitiveResource/include/PrimitiveResource.h
service/resource-encapsulation/src/common/primitiveResource/include/PrimitiveResourceImpl.h