Skip to content

Commit

Permalink
added the log in dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
Fixstars-momoko committed Nov 13, 2023
1 parent caeeac0 commit c8d466f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bb/image-io/rt_u3v.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,25 @@ class U3V {
}

void dispose(){
log::debug("U3V::dispose() :: is called");
for (auto i=0; i<devices_.size(); ++i) {
auto d = devices_[i];
arv_device_execute_command(d.device_, "AcquisitionStop", &err_);
log::debug("U3V::dispose() :: AcquisitionStop");
/*
Note:
unref stream also unref the buffers pushed to stream
all buffers are in stream so do not undef buffres separately
*/
auto start = std::chrono::system_clock::now();
g_object_unref(reinterpret_cast<gpointer>(d.stream_));
auto end = std::chrono::system_clock::now();
log::debug("U3V::dispose() :: g_object_unref took {} ms", std::chrono::duration_cast<std::chrono::milliseconds>(end-start).count());

start = std::chrono::system_clock::now();
g_object_unref(reinterpret_cast<gpointer>(d.device_));
end = std::chrono::system_clock::now();
log::debug("U3V::dispose() :: g_object_unref took {} ms", std::chrono::duration_cast<std::chrono::milliseconds>(end-start).count());
}

devices_.clear();
Expand All @@ -201,6 +210,7 @@ class U3V {
// TODO: get rid of the following code; no call destructor from the member function.
//------------------------------------------------------------------------------------------
instance_.reset(nullptr);
log::debug("U3V::dispose() :: Instance is deleted");
}

void SetGain(int32_t sensor_idx, const std::string key, double v) {
Expand Down

0 comments on commit c8d466f

Please sign in to comment.