UPnP doesn't always close Active UPnP Redirects

Hi, I use UPnP and I have been wondering why Active UPnP Redirects don't always close themselves. They occasionally seem to stay open after a specific program that created them has been exited and the computer shut off. I can close them manually, but I thought it should be automatic. Do programs have the ability to tell the UPnP portion of the router to leave the port open forever until told otherwise?

I think the redirects are closed after a set amount of time, the default being ten minutes, instead of when a program stops using it, you can set the time you'd prefer (in seconds), you can also set the maximum number of redirects you want allowed, default is 20. In Luci, those settings would be in Services>UPnP>Advanced Settings. Clean rules threshold is maximum number of redirects, Clean rules interval is time between clearing redirects.

Thanks, I will look. Because right now they will stay open for days.