Kieran Mansley wrote:
On 12 Aug 2010, at 20:16, Jeff Barber wrote:
I'd like to see someone more authoritative (like Simon or Kieran?)
weigh in on this but I'm pretty sure that the advice you cited is just
plain wrong.
Yes, it's very wrong. It may once have been true in the dim past,
Hmm, "dim past"... that post seems to be only less than 2 months old,
however, I don't remember having read it or I would have told the author
that it's wrong...
but even so it references memory after it was freed
And that's the point at which I'm really confused: Either our
documentation is really really bad or the author of that post should
first start programming with something easier than lwIP... accessing
freed memory seems like a beginner's mistake to me (sorry if this sounds
rude!), and (unfortunately) lwIP is a bit more complicated to handle
than a simple "hello world" example :-(
Anyway:
1) pbuf_free() on the pbuf passed in is definitively the right thing to
do (there are ways how to call pbuf_free on every single pbuf in a
chain, but that involves more code and is not really advised)... and
2) please start from the existing examples in contrib: most of them are
correct, and if they aren't we can fix them. Just starting from
something you read somewhere isn't a good idea as you never know who
wrote that and if it is correct...
BTW: Jeff, I don't think you really need our opinion on this as I fully
agree to everything you wrote ;-)
Simon
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users