Skip to content

Handle exception in uvc_sensor::acquire_power - #7604

Merged
maloel merged 4 commits into
realsenseai:developmentfrom
aangerma:RS5-9071
Oct 22, 2020
Merged

Handle exception in uvc_sensor::acquire_power#7604
maloel merged 4 commits into
realsenseai:developmentfrom
aangerma:RS5-9071

Conversation

@aangerma

@aangerma aangerma commented Oct 19, 2020

Copy link
Copy Markdown
Contributor

Reduce the reference counter in case that exception throws in acquire_power
Tracked on: RS5-9071

Comment thread src/sensor.cpp
_user_count.fetch_add( -1 );
LOG_ERROR( "acquire_power failed " );
throw;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about void uvc_sensor::release_power() below - could the fix be applicable there as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not needed because the fix is for the cases that release_power() didn't call because of exception on acquire_power().

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But is it possible that setting D3 would throw?

@maloel
maloel merged commit aed6b0a into realsenseai:development Oct 22, 2020
@ev-mp ev-mp changed the title Fix for RS5-9071 - Handle exception in uvc_sensor::acquire_power Handle exception in uvc_sensor::acquire_power Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants