Make the dbushelper own its own bus handle.

The dbushelper implements an interface that should not be sdbusplus
specific. By making the implementation own the sdbusplus aspects, an
alternate implementation can be swapped in.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I4109772499421e2e6497a0fcad663ebbd1210a7c
diff --git a/dbus/dbuspassive.hpp b/dbus/dbuspassive.hpp
index 07a6ab2..fa0c5da 100644
--- a/dbus/dbuspassive.hpp
+++ b/dbus/dbuspassive.hpp
@@ -42,12 +42,13 @@
   public:
     static std::unique_ptr<ReadInterface> createDbusPassive(
         sdbusplus::bus::bus& bus, const std::string& type,
-        const std::string& id, DbusHelperInterface* helper,
+        const std::string& id, std::unique_ptr<DbusHelperInterface> helper,
         const conf::SensorConfig* info,
         const std::shared_ptr<DbusPassiveRedundancy>& redundancy);
 
     DbusPassive(sdbusplus::bus::bus& bus, const std::string& type,
-                const std::string& id, DbusHelperInterface* helper,
+                const std::string& id,
+                std::unique_ptr<DbusHelperInterface> helper,
                 const struct SensorProperties& settings, bool failed,
                 const std::string& path,
                 const std::shared_ptr<DbusPassiveRedundancy>& redundancy);
@@ -68,7 +69,7 @@
     sdbusplus::server::match::match _signal;
     int64_t _scale;
     std::string _id; // for debug identification
-    DbusHelperInterface* _helper;
+    std::unique_ptr<DbusHelperInterface> _helper;
 
     std::mutex _lock;
     double _value = 0;