Resource Container - Global variable name changes to avoid crash in TIZEN.
authorarya.k <arya.kumar@samsung.com>
Tue, 13 Oct 2015 10:22:35 +0000 (15:52 +0530)
committerUze Choi <uzchoi@samsung.com>
Wed, 14 Oct 2015 01:36:09 +0000 (01:36 +0000)
Change-Id: I19075bd3a1dbea9cfbd81193cc26b6830e8ba669
Signed-off-by: arya.k <arya.kumar@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3851
Reviewed-by: Abhishek Pandey <abhi.siso@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Markus Jung <markus.jung@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/resource-container/examples/BMISensorBundle/src/BMISensorBundleActivator.cpp
service/resource-container/examples/DiscomfortIndexSensorBundle/src/DISensorBundleActivator.cpp
service/resource-container/examples/HueSampleBundle/src/HueSampleBundleActivator.cpp
service/resource-container/examples/tizen/ContainerServerApp/.cproject
service/resource-container/examples/tizen/ContainerServerApp/src/container.cpp

index b54622b..f322834 100644 (file)
@@ -25,7 +25,7 @@
 #include "BMISensorResource.h"
 
 
-BMISensorBundleActivator *bundle;
+BMISensorBundleActivator *g_bundleBMI;
 
 BMISensorBundleActivator::BMISensorBundleActivator()
 {
@@ -105,22 +105,22 @@ void BMISensorBundleActivator::destroyResource(BundleResource::Ptr resource)
 extern "C" void bmisensor_externalActivateBundle(ResourceContainerBundleAPI *resourceContainer,
         std::string bundleId)
 {
-    bundle = new BMISensorBundleActivator();
-    bundle->activateBundle(resourceContainer, bundleId);
+    g_bundleBMI = new BMISensorBundleActivator();
+    g_bundleBMI->activateBundle(resourceContainer, bundleId);
 }
 
 extern "C" void bmisensor_externalDeactivateBundle()
 {
-    bundle->deactivateBundle();
-    delete bundle;
+    g_bundleBMI->deactivateBundle();
+    delete g_bundleBMI;
 }
 
 extern "C" void bmisensor_externalCreateResource(resourceInfo resourceInfo)
 {
-    bundle->createResource(resourceInfo);
+    g_bundleBMI->createResource(resourceInfo);
 }
 
 extern "C" void bmisensor_externalDestroyResource(BundleResource::Ptr pBundleResource)
 {
-    bundle->destroyResource(pBundleResource);
+    g_bundleBMI->destroyResource(pBundleResource);
 }
index 147e3c4..27ac1cf 100644 (file)
@@ -24,7 +24,7 @@
 #include <sstream>
 #include "DiscomfortIndexSensorResource.h"
 
-DISensorBundleActivator *bundle;
+DISensorBundleActivator *g_bundleDI;
 
 DISensorBundleActivator::DISensorBundleActivator()
 {
@@ -106,22 +106,22 @@ void DISensorBundleActivator::destroyResource(BundleResource::Ptr resource)
 extern "C" void disensor_externalActivateBundle(ResourceContainerBundleAPI *resourceContainer,
         std::string bundleId)
 {
-    bundle = new DISensorBundleActivator();
-    bundle->activateBundle(resourceContainer, bundleId);
+    g_bundleDI = new DISensorBundleActivator();
+    g_bundleDI->activateBundle(resourceContainer, bundleId);
 }
 
 extern "C" void disensor_externalDeactivateBundle()
 {
-    bundle->deactivateBundle();
-    delete bundle;
+    g_bundleDI->deactivateBundle();
+    delete g_bundleDI;
 }
 
 extern "C" void disensor_externalCreateResource(resourceInfo resourceInfo)
 {
-    bundle->createResource(resourceInfo);
+    g_bundleDI->createResource(resourceInfo);
 }
 
 extern "C" void disensor_externalDestroyResource(BundleResource::Ptr pBundleResource)
 {
-    bundle->destroyResource(pBundleResource);
+    g_bundleDI->destroyResource(pBundleResource);
 }
index 903f6ba..36fad24 100644 (file)
@@ -26,7 +26,7 @@
 
 using namespace OIC::Service;
 
-HueSampleBundleActivator *bundle;
+HueSampleBundleActivator *g_bundleHUE;
 
 HueSampleBundleActivator::HueSampleBundleActivator()
 {
@@ -108,22 +108,22 @@ void HueSampleBundleActivator::destroyResource(BundleResource::Ptr pBundleResour
 extern "C" void huesample_externalActivateBundle(ResourceContainerBundleAPI *resourceContainer,
         std::string bundleId)
 {
-    bundle = new HueSampleBundleActivator();
-    bundle->activateBundle(resourceContainer, bundleId);
+    g_bundleHUE = new HueSampleBundleActivator();
+    g_bundleHUE->activateBundle(resourceContainer, bundleId);
 }
 
 extern "C" void huesample_externalDeactivateBundle()
 {
-    bundle->deactivateBundle();
-    delete bundle;
+    g_bundleHUE->deactivateBundle();
+    delete g_bundleHUE;
 }
 
 extern "C" void huesample_externalCreateResource(resourceInfo resourceInfo)
 {
-    bundle->createResource(resourceInfo);
+    g_bundleHUE->createResource(resourceInfo);
 }
 
 extern "C" void huesample_externalDestroyResource(BundleResource::Ptr pBundleResource)
 {
-    bundle->destroyResource(pBundleResource);
+    g_bundleHUE->destroyResource(pBundleResource);
 }
index 13e4714..6b50869 100644 (file)
@@ -98,7 +98,6 @@
                                                                </option>
                                                                <option id="gnu.cpp.compiler.option.include.paths.1501991974" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;C:\boost_1_56_0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;..\..\..\..\src\resourceBroker\include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;..\..\..\..\src\resourceCache\include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;..\..\..\..\src\common\utils\include&quot;"/>
index 73e6cdd..a6f06a0 100644 (file)
@@ -631,7 +631,6 @@ naviframe_pop_cb(void *data, Elm_Object_Item *it)
 // Method to set up server screens
 void containerCreateUI(void *data, Evas_Object *obj, void *event_info)
 {
-       dlog_print(DLOG_INFO, LOG_TAG, "#### container UI");
     s_containerFlag = false;
     s_hueBundleFlag = false;
     Evas_Object *layout;
@@ -646,7 +645,6 @@ void containerCreateUI(void *data, Evas_Object *obj, void *event_info)
     scroller = elm_scroller_add(nf);
     elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
     elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
-    dlog_print(DLOG_INFO, LOG_TAG, "#### container UI 1");
 
     // Layout
     layout = elm_layout_add(nf);
@@ -654,21 +652,18 @@ void containerCreateUI(void *data, Evas_Object *obj, void *event_info)
     evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
     elm_object_content_set(scroller, layout);
-    dlog_print(DLOG_INFO, LOG_TAG, "#### container UI 2");
 
     // Button
     start_button = elm_button_add(layout);
     elm_object_part_content_set(layout, "start_button", start_button);
     elm_object_text_set(start_button, "Start Container");
     evas_object_smart_callback_add(start_button, "clicked", startContainer, NULL);
-    dlog_print(DLOG_INFO, LOG_TAG, "#### container UI 3");
 
     // Button
     stop_button = elm_button_add(layout);
     elm_object_part_content_set(layout, "stop_button", stop_button);
     elm_object_text_set(stop_button, "Stop Container");
     evas_object_smart_callback_add(stop_button, "clicked", stopContainer, NULL);
-    dlog_print(DLOG_INFO, LOG_TAG, "#### container UI 4");
 
     // List
     listnew = elm_list_add(layout);
@@ -676,7 +671,6 @@ void containerCreateUI(void *data, Evas_Object *obj, void *event_info)
     evas_object_smart_callback_add(listnew, "selected", list_selected_cb, NULL);
     elm_object_part_content_set(layout, "listnew", listnew);
     elm_list_go(listnew);
-    dlog_print(DLOG_INFO, LOG_TAG, "#### container UI 5");
 
     // log_entry - text area for log
     log_entry = elm_entry_add(layout);
@@ -689,5 +683,4 @@ void containerCreateUI(void *data, Evas_Object *obj, void *event_info)
 
     nf_it = elm_naviframe_item_push(nf, "Resource Container", NULL, NULL, scroller, NULL);
     elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, NULL);
-    dlog_print(DLOG_INFO, LOG_TAG, "#### container UI 6");
 }