X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fcxx%2Fclasses.cpp;h=9bce464c9de979099c6b1faf2a0ab72baba70dcd;hb=f36f7d02826a4240c5bb56ccc0dfd7d689093765;hp=9013e41ae9d44ad004cfe2a9b218e742a719432e;hpb=1de3ccede95a7b3535b67c6ade510715fe85d4d3;p=libsigrok.git diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index 9013e41a..9bce464c 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -871,16 +871,6 @@ vector> Session::devices() void Session::remove_devices() { - for (auto entry : _owned_devices) - { - // We own this device. Make sure it's not referenced. - auto device = entry.second; - auto ptr = device->get_shared_pointer(this); - if (ptr.use_count() > 1) - throw Error(SR_ERR_BUG); - delete device; - } - _owned_devices.clear(); _other_devices.clear(); check(sr_session_dev_remove_all(_structure)); }