Hello, while working on https://github.com/jaor/xmobar/pull/429 I stumbled upon a resource leak as makeNL80211Socket was called many times until the OS limit was reached. The documentation of makeNL80211Socket (and other functions in this library that return a socket) didn't remind me that I need to somehow manually take care of releasing this resource. Moreover, NL80211Socket is opaque, and so I can't find a way to use System.Linux.Netlink.closeSocket with it.
Hello, while working on https://github.com/jaor/xmobar/pull/429 I stumbled upon a resource leak as makeNL80211Socket was called many times until the OS limit was reached. The documentation of makeNL80211Socket (and other functions in this library that return a socket) didn't remind me that I need to somehow manually take care of releasing this resource. Moreover, NL80211Socket is opaque, and so I can't find a way to use System.Linux.Netlink.closeSocket with it.
I propose to add appropriate helpers like withFile or https://hackage.haskell.org/package/ncurses-0.2.16/docs/src/UI.NCurses.html#runCurses for automatic resource handling and to make it clear in the documentation that they're the preferred way to avoid leaks.