I don't think the resource will be freed explicitly, since it is a ressource allocated through the php-module.
It would only be freed when you use a webserver which does not re-used worker-threads for subsequent requests.