Remove performance from dbusconfig. fix crasher in varianttype. 0.11.806
authorKevron Rees <kevron.m.rees@intel.com>
Wed, 5 Mar 2014 18:30:35 +0000 (10:30 -0800)
committerKevron Rees <kevron.m.rees@intel.com>
Wed, 5 Mar 2014 18:30:35 +0000 (10:30 -0800)
CMakeLists.txt
examples/dbusconfig
plugins/dbus/automotivemanager.cpp
plugins/dbus/varianttype.cpp
plugins/gpsnmea/gpsnmea.cpp

index c644a14..3867dbd 100644 (file)
@@ -6,7 +6,7 @@ set(CMAKE_BUILD_TYPE, Debug)
 include(FindPkgConfig)
 
 set(PROJECT_NAME "automotive-message-broker")
-set(PROJECT_VERSION "0.11.805")
+set(PROJECT_VERSION "0.11.806")
 set(PROJECT_CODENAME "veyron")
 set(PROJECT_QUALITY "alpha")
 
index ca252a2..3c37dcb 100644 (file)
@@ -3,7 +3,7 @@
                {
                        "name" : "ExampleSouce",
                        "path" : "/usr/lib/automotive-message-broker/examplesourceplugin.so",
-                       "delay" : "6"
+                       "delay" : "1000"
                }
        ],
        "sinks": [
index b5fb149..c108a2e 100644 (file)
@@ -345,12 +345,14 @@ static void signalCallback( GDBusConnection *connection,
                                {
                                        DebugOut()<<"unreferencing "<<n<<" from the subscription of "<<iface->objectPath()<<endl;
                                        manager->subscribedProcesses[iface].remove(n);
+                                       DebugOut()<<"new ref count: "<<manager->subscribedProcesses[iface].size()<<endl;
                                }
                        }
 
                        if(manager->subscribedProcesses[iface].empty())
                        {
-                               DebugOut()<<"No more subscribers.  Unregistering."<<endl;
+                               DebugOut()<<"No more subscribers.  Unregistering: "<<iface->objectPath()<<endl;
+                               manager->subscribedProcesses.erase(iface);
                                iface->unregisterObject();
                        }
                }
index fd337a6..abf31be 100644 (file)
@@ -66,9 +66,10 @@ void VariantType::fromGVariant(GVariant *val)
                /// TODO: throw dbus exception
                if(!reply->success)
                {
-                       DebugOut(DebugOut::Error)<<"setProperty fail: "<<reply->error<<endl;
+                       DebugOut(DebugOut::Error)<<"SetProperty fail: "<<reply->error<<endl;
                }
-               delete v;
+               ///TODO: we segfault here.
+               ///if(v) delete v;
                delete reply;
        };
 
index 873d8dc..e1c83b9 100644 (file)
@@ -193,22 +193,29 @@ void Location::parseGpgga(string gpgga)
 
 void Location::parseTime(string h, string m, string s, string dd, string mm, string yy)
 {
-       tm t;
-       t.tm_hour = boost::lexical_cast<int>(h);
-       t.tm_min = boost::lexical_cast<int>(m);
-       t.tm_sec = boost::lexical_cast<int>(s);
-       t.tm_mday = boost::lexical_cast<int>(dd);
-       t.tm_mon = boost::lexical_cast<int>(mm);
-       t.tm_year = boost::lexical_cast<int>(yy) + 100;
+       try
+       {
+               tm t;
+               t.tm_hour = boost::lexical_cast<int>(h);
+               t.tm_min = boost::lexical_cast<int>(m);
+               t.tm_sec = boost::lexical_cast<int>(s);
+               t.tm_mday = boost::lexical_cast<int>(dd);
+               t.tm_mon = boost::lexical_cast<int>(mm);
+               t.tm_year = boost::lexical_cast<int>(yy) + 100;
 
-       time_t time = mktime(&t);
+               time_t time = mktime(&t);
 
-       BasicPropertyType<double> temp(GPSTIME,(double)time);
+               BasicPropertyType<double> temp(GPSTIME,(double)time);
 
-       if(mGpsTime != temp)
+               if(mGpsTime != temp)
+               {
+                       mGpsTime = temp;
+                       routingEngine->updateProperty(&mGpsTime, mUuid);
+               }
+       }
+       catch(...)
        {
-               mGpsTime = temp;
-               routingEngine->updateProperty(&mGpsTime, mUuid);
+               DebugOut(DebugOut::Warning)<<"Failed to parse time "<<endl;
        }
 }