You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: