address bugprone-exception-escape warning from clang-tidy. - #1894
fujitatomoya wants to merge 1 commit into
Conversation
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
|
@ivanpauno no, im not sure how to do that... @alsora could i have some help here? or could you tell me how to verify? |
| RCLCPP_DEBUG(logger, "Load library %s", library_name.c_str()); | ||
| auto loader = new class_loader::ClassLoader(library_name); | ||
| try { | ||
| auto loader = new class_loader::ClassLoader(library_name); |
There was a problem hiding this comment.
this code does not compile.
you should have
class_loader::ClassLoader * loader = nullptr;
outside of the try catch otherwise you will can't access it later
There was a problem hiding this comment.
slightly unrelated, but is there a reason why we use a raw pointer here?
this is not even deallocated at the end of the file (not a big deal, but still bad to see).
alsora
left a comment
There was a problem hiding this comment.
The code does not compile as it is.
However, with a minimal change (described above) it does and the try catch block fixes the bugprone warning.
|
Sorry, I made a mistake. The error is still there even after your patch. |
|
@fujitatomoya I stole your try-catch block and I opened a PR that fixes the issue: #1895 |
draft for #1890
Signed-off-by: Tomoya Fujita Tomoya.Fujita@sony.com