|
From: | address@hidden |
Subject: | Re: [lwip-users] Data passed to UDP receive callback |
Date: | Mon, 10 Aug 2009 20:01:58 +0200 |
User-agent: | Thunderbird 2.0.0.22 (Macintosh/20090605) |
Ben Hastings wrote:
On a side note, what happens if the pbuf is freed before the end of the callback? Does that also free the memory that the address pointer points to?
That's a good point. Since p->ref is (almost always) == 1 at the point where the pbuf is passed to the receive callback, it will get freed when pbuf_free(p) is called. I'd still vote for copying the address before calling the receive callback function. It might be a *little* less performant, but safer.
Simon
[Prev in Thread] | Current Thread | [Next in Thread] |