Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
connection: ensure sr_disconnect is called
If a client program does not call disconnect() it leaves resources open in sysrepo SHM. Use ffi.gc to register a destructor for the connection pointer. Since sr_connect can be a long operation (all YANG models must be parsed), if a signal occurs at that time, ffi.gc will not be called and no destructor will be registered. Block signals before calling sr_connect() and unblock them just after registering sr_disconnect. Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
- Loading branch information