Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / service / protocol-plugin / plugin-manager / src / CpluffAdapter.cpp
index 8db6d6e..e2b3d68 100644 (file)
@@ -194,20 +194,6 @@ int CpluffAdapter::loadPluginInfoToManager(const std::string path)
         }
         if (plugin_compare_flag)
         {
-            //Auto plugin detection is disabled
-            /*
-            try
-            {
-                boost::thread *t = new boost::thread(boost::bind(&CpluffAdapter::observePluginPath,
-                                                     //this, (void *)path.c_str()));
-                                                     this, (void *)m_cp_plugins[i]->plugin_path));
-                m_thread_g.add_thread(t);
-            }
-            catch (...)
-            {
-                printf("thread throw exception\n");
-            }
-            */
             m_plugins.push_back(*plugin);
             delete(plugin);
         }
@@ -313,7 +299,8 @@ std::vector<Plugin> *CpluffAdapter::findPlugins(const std::string key, const std
 
     for (unsigned int i = 0; i < m_plugins.size(); i++)
     {
-        if (!m_plugins[i].getValueByAttribute(key).compare(value))
+        std::string attributeValue = m_plugins[i].getValueByAttribute(key);
+        if (!attributeValue.empty() && !attributeValue.compare(value))
         {
             re_plugins->push_back(m_plugins[i]);
         }