Sane icon indicating copy to clipboard operation
Sane copied to clipboard

Sane leaks filedescriptors

Open emdete opened this issue 1 year ago • 0 comments

the init/exit sequence is not cleaning up all resources. this short sequence shows the case:

from sane import init, get_devices, exit as deinit

for _ in range(99):
	init()
	d = get_devices()
	with open("/etc/hosts") as f:
		print(f.fileno())
	deinit()

as you can see the fd will increase (by 78 in my case).

emdete avatar Sep 05 '24 13:09 emdete