made stuff actually work
diff --git a/aos/crio/hardware/digital_source.h b/aos/crio/hardware/digital_source.h
index 3767508..52a50ba 100644
--- a/aos/crio/hardware/digital_source.h
+++ b/aos/crio/hardware/digital_source.h
@@ -39,7 +39,9 @@
static const float kDefaultUpperVoltage = 4;
// Will set up the voltages on trigger.
- AnalogTriggerOutput(const ::std::unique_ptr< ::AnalogTrigger> &trigger,
+ // Takes ownership of trigger to make sure it stays around so that the output
+ // it creates won't blow up (because it holds on to and uses it).
+ AnalogTriggerOutput(::std::unique_ptr< ::AnalogTrigger> trigger,
::AnalogTriggerOutput::Type type,
float lowerVoltage = kDefaultLowerVoltage,
float upperVoltage = kDefaultUpperVoltage);
@@ -50,6 +52,8 @@
virtual ::DigitalSource *source() const { return output_.get(); }
private:
+ // Might be NULL.
+ const ::std::unique_ptr< ::AnalogTrigger> trigger_;
const ::std::unique_ptr< ::AnalogTriggerOutput> output_;
};