Graceful logoff from a published application renders the session on RDS host in Active state.
The published application that you started originally is no longer running in the session.
It is possible to log off the affected session from RAS Console or Task Manager.
Some process still running in the session prevents Windows from logging the session off.
It could be spawned by the published application, by some scripts, or somehow else.
Please create a new REG_DWORD value with the name of the process causing the issue in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\SysProcs on the RDS host:
It will notify the operating system that the process can be terminated automatically when needed.
More info can be found in this Microsoft KB article.