Fix double-free issue in File::create
[pulseview.git] / pv / device / devinst.cpp
index 86595ae79069a9c7e2b9e33700e1c5eee7be8661..0301063440200d4b693105623f329fbce303b9f6 100644 (file)
@@ -56,7 +56,7 @@ SigSession* DevInst::owner() const
        return _owner;
 }
 
-GVariant* DevInst::get_config(const sr_probe_group *group, int key)
+GVariant* DevInst::get_config(const sr_channel_group *group, int key)
 {
        GVariant *data = NULL;
        assert(_owner);
@@ -67,7 +67,7 @@ GVariant* DevInst::get_config(const sr_probe_group *group, int key)
        return data;
 }
 
-bool DevInst::set_config(const sr_probe_group *group, int key, GVariant *data)
+bool DevInst::set_config(const sr_channel_group *group, int key, GVariant *data)
 {
        assert(_owner);
        sr_dev_inst *const sdi = dev_inst();
@@ -79,7 +79,7 @@ bool DevInst::set_config(const sr_probe_group *group, int key, GVariant *data)
        return false;
 }
 
-GVariant* DevInst::list_config(const sr_probe_group *group, int key)
+GVariant* DevInst::list_config(const sr_channel_group *group, int key)
 {
        GVariant *data = NULL;
        assert(_owner);
@@ -90,19 +90,19 @@ GVariant* DevInst::list_config(const sr_probe_group *group, int key)
        return data;
 }
 
-void DevInst::enable_probe(const sr_probe *probe, bool enable)
+void DevInst::enable_channel(const sr_channel *channel, bool enable)
 {
        assert(_owner);
        sr_dev_inst *const sdi = dev_inst();
        assert(sdi);
-       for (const GSList *p = sdi->probes; p; p = p->next)
-               if (probe == p->data) {
-                       const_cast<sr_probe*>(probe)->enabled = enable;
+       for (const GSList *p = sdi->channels; p; p = p->next)
+               if (channel == p->data) {
+                       const_cast<sr_channel*>(channel)->enabled = enable;
                        config_changed();
                        return;
                }
 
-       // Probe was not found in the device
+       // Channel was not found in the device
        assert(0);
 }
 
@@ -126,13 +126,13 @@ bool DevInst::is_trigger_enabled() const
 
 void DevInst::start()
 {
-       if (sr_session_start() != SR_OK)
+       if (sr_session_start(SigSession::_sr_session) != SR_OK)
                throw tr("Failed to start session.");
 }
 
 void DevInst::run()
 {
-       sr_session_run();
+       sr_session_run(SigSession::_sr_session);
 }
 
 } // device