Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It looks to me in the C version, he only frees the first listener. The C++ version also provides the listeners as a set. The C version doesn't mind if you add the same listener multiple times, so to be apples to apples you'd use a vector, but the code wouldn't change otherwise, so no problem there.


- That's an array of pointers; the listeners themselves aren't malloced

- The set / list difference is noted just below the code samples




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: