-
Notifications
You must be signed in to change notification settings - Fork 85
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 ping-pong examples (#226) (#227) #228
Fix ping-pong examples (#226) (#227) #228
Conversation
@imstevenpmwork can you double check if it fixes both of your issues? |
Hello Carlos, thanks for the quick reply. I tested this PR with the same system and I confirm both of the problems are solved. Code changes look good too to me |
@@ -79,8 +100,8 @@ int main(int argc, char** argv) { | |||
_z_mutex_unlock(&mutex); | |||
z_free(results); | |||
z_free(data); | |||
z_drop(z_move(sub)); | |||
z_drop(z_move(pub)); |
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.
z_drop should be favored in c11 examples
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.
Done!
examples/unix/c11/z_pong.c
Outdated
while (getchar() != 'q') { | ||
} | ||
z_drop(z_move(sub)); | ||
|
||
z_undeclare_subscriber(z_move(sub)); |
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.
prefer z_drop
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.
Done!
z_undeclare_subscriber(z_move(sub)); | ||
z_undeclare_publisher(z_move(pub)); | ||
z_close(z_move(session)); | ||
z_undeclare_subscriber(z_subscriber_move(&sub)); |
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.
don't switch this to z_drop, it's a c99 example (leaving the comment just in case)
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.
Done!
examples/windows/z_ping.c
Outdated
@@ -77,8 +97,8 @@ int main(int argc, char** argv) { | |||
_z_mutex_unlock(&mutex); | |||
z_free(results); | |||
z_free(data); | |||
z_drop(z_move(sub)); | |||
z_drop(z_move(pub)); | |||
z_undeclare_publisher(z_move(pub)); |
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.
prefer z_drop
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.
Done!
examples/windows/z_pong.c
Outdated
while (getchar() != 'q') { | ||
} | ||
z_drop(z_move(sub)); | ||
|
||
z_undeclare_subscriber(z_move(sub)); |
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.
prefer z_drop
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.
Done!
Fix #226 and #227