-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport2/v5.12 #1335
Backport2/v5.12 #1335
Conversation
…apply_sample threadsafe. Co-authored-by: Rex Schilasky <[email protected]>
…lback_map Co-authored-by: Rex Schilasky <[email protected]>
Co-authored-by: Rex Schilasky <[email protected]>
…er (#1316) Probably cherry pick to 5.11 / 5.12. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
"Number" and "Rule" were mixed up, before
- Properly implement destructor (in inherited classes)! -> Destroy may not be called in base CMsgSubscriber class as this can lead to stack unwinding (most likely causes an exception in destructor, or leads to already deleted functions of derived class being called when they are already deleted) - Correct order of RemReceiveCallback and resetting internal pointer - protect function pointer with mutex. - Make testcase "harder" to more easily trigger race conditions.
This PR protects the m_payload member variable and thus makes the Send() function reentrant, as it may be called simultaneously from different threads. Co-authored-by: Florian Reimold <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -219,9 +222,12 @@ namespace eCAL | |||
**/ | |||
bool RemReceiveCallback() | |||
{ | |||
bool ret = CSubscriber::RemReceiveCallback(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ret' is not initialized [cppcoreguidelines-init-variables]
bool ret = CSubscriber::RemReceiveCallback(); | |
bool ret = 0 = CSubscriber::RemReceiveCallback(); |
@@ -245,7 +251,11 @@ namespace eCAL | |||
private: | |||
void ReceiveCallback(const char* topic_name_, const struct eCAL::SReceiveCallbackData* data_) | |||
{ | |||
MsgReceiveCallbackT fn_callback(m_cb_callback); | |||
MsgReceiveCallbackT fn_callback = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'fn_callback' is not initialized [cppcoreguidelines-init-variables]
MsgReceiveCallbackT fn_callback = nullptr; | |
MsgReceiveCallbackT fn_callback = 0 = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -54,6 +54,11 @@ namespace eCAL | |||
#endif //ECAL_NPCAP_SUPPORT | |||
} | |||
|
|||
CUDPReceiver::~CUDPReceiver() | |||
{ | |||
Destroy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to virtual method 'CUDPReceiver::Destroy' during destruction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall]
Destroy();
^
Additional context
ecal/core/src/io/udp_receiver.cpp:58: Call to virtual method 'CUDPReceiver::Destroy' during destruction bypasses virtual dispatch
Destroy();
^
@@ -35,6 +35,12 @@ namespace eCAL | |||
{ | |||
public: | |||
CUDPReceiver(); | |||
~CUDPReceiver(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: annotate this function with 'override' or (rarely) 'final' [cppcoreguidelines-explicit-virtual-functions]
~CUDPReceiver(); | |
~CUDPReceiver() override; |
Backport of commits 18.01.24 - 25.01.24