Skip to content
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

Error in Arduino_feed.cpp #62

Open
supuflounder opened this issue Aug 23, 2018 · 1 comment
Open

Error in Arduino_feed.cpp #62

supuflounder opened this issue Aug 23, 2018 · 1 comment
Labels
Milestone

Comments

@supuflounder
Copy link

supuflounder commented Aug 23, 2018

This is a failure to free the correct object.

In my source, I have lines 41-42 as
41. if(_get_pub)
42. delete _pub;

which should actually delete _get_pub.

In general, every C++ implementation I have encountered assumes the argument to delete can be NULL, eliminating the need for the test.

In addition, doing delete twice on the same pointer has undefined behavior, and can even corrupt the heap

I was trying to understand why there is a lastValue operation on a feed, but not a group, and did not understand why publishing a zero-length string did anything. If this truly returns the last value for a feed, it solves my problem, sort of, but I'm using a group, and would like to see this extended to cover group feeds.

@brentru brentru added the bug label Aug 23, 2018
@brentru brentru added this to the 2.7.17 milestone Aug 23, 2018
@brentru
Copy link
Member

brentru commented Aug 25, 2018

Group feeds will be receiving a get function in the next few weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants