Stability enhancemets - #7272
Conversation
Change-Id: I5314aee307905ea5801e8b9bed92880739ef8953
Refactoring of error-polling mechanism to stop after device disconnect Change-Id: I0082a9277d05c4c607bf92d527d397328e688f58 Add AO deactivation in dtor for error polling Change-Id: Ie18308ff4536fd40cac8a61d07b7b21c81522723
Change-Id: I476befc583db749f6bbeff9dbaef553bb1c19de3
| polling_errors_disable(polling_error_handler* handler) | ||
| : _polling_error_handler(handler), _value(1) | ||
| polling_errors_disable(std::unique_ptr<polling_error_handler>& handler) | ||
| : _polling_error_handler(std::move(handler)), _value(1) |
There was a problem hiding this comment.
Not sure I like this: why not make it a shared_ptr<> instead, then we don't run into a situation where the value is now null but there really still is a handler?
There was a problem hiding this comment.
The fix addresses only the issue of the polling handler in 'orphan' mode after device is (forcibly) disconnected.
In that case the device is indeed is 0xdeadbeef but the handler remained active and could fail on dereferencing invalid pointer.
With this design the handler will remain intact, and after device disconnects it will stop the active object in dtor.
So the polling events will be handled properly during the period between device disconnect and the dtor call
There was a problem hiding this comment.
I also recognize more things to improve in the design of active objects lifetime control but this will require a separate session
| { | ||
| return _locked_transfer->send_receive({ details.sendCommandData.begin(),details.sendCommandData.end()}); | ||
| } | ||
| else |
There was a problem hiding this comment.
Can remove the else clause and keep all the other code unindented
Change-Id: I89c93e79430a2bda0aa9ad8c5d73811ff9dcfa8e
…llow up on PR realsenseai#7272 (cherry picked from commit 78ee0f0) # Conflicts: # src/hdr-config.cpp
No description provided.