Tested logging out and in several times and opening two or three remote files with xed and libreoffice.
For example with 2 files, the first time the app is called it opens the file and doesn't end (app count = 1), the second file is opened (app count = 2) and the app exists immediately (app count = 1). Only when the app exits the app count == 0 and the temporary directories are deleted.