-
Notifications
You must be signed in to change notification settings - Fork 380
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
Fix ACE_Logging_Strategy::handle_timeout
returning -1
without releasing ACE_Log_Msg
lock
#2259
base: master
Are you sure you want to change the base?
Conversation
ACE_Logging_Strategy::handle_timeou
t returning -1
without releasing ACE_Log_Msg
lockACE_Logging_Strategy::handle_timeout
returning -1
without releasing ACE_Log_Msg
lock
…ng ACE_Log_Msg lock
5324f14
to
9dd8a78
Compare
Don’t force push, makes it harder to review, use nullptr instead of 0 |
OK. Shall I combine two commits into one after reviewed so that keep one issue per commit? |
No need to squash, please add/extend a unit test as reproducer |
ACE/ace/Logging_Strategy.cpp
Outdated
@@ -442,7 +442,8 @@ ACE_Logging_Strategy::handle_timeout (const ACE_Time_Value &, | |||
// Close the current ostream. | |||
#if defined (ACE_LACKS_IOSTREAM_TOTALLY) | |||
FILE *output_file = (FILE *) this->log_msg_->msg_ostream (); | |||
ACE_OS::fclose (output_file); | |||
if (output_file) | |||
ACE_OS::fclose (output_file); |
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.
setting to nullptr only when it is non null?
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.
After this line, output_file
is assigned before using.
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.
I meant the part this->log_msg_->msg_ostream (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.
OK
Before changed, there were two snippets in
ACE_Logging_Strategy::handle_timeout
:whiich would return without releasing
ACE_Log_Msg
lock