Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux: delete temp files as soon as they are not needed #63

Merged
merged 2 commits into from
Oct 17, 2018

Conversation

meskio
Copy link
Contributor

@meskio meskio commented Oct 10, 2018

Stop generating one file in /tmp for each icon change. Let's move the
clean up to the set icon instead of waiting for the quit clean up.
Unlink will remove the file from /tmp, but app_indicator will hold a
descriptor until it finishes with it.

@meskio
Copy link
Contributor Author

meskio commented Oct 11, 2018

It looks like I'm too agressive unlinking the file, I'll try to unlink it only after a new one is being set.

@meskio meskio changed the title linux: unlink temp files as soon as they are in use linux: delete temp files as soon as they are not needed Oct 12, 2018
Stop generating one file in /tmp for each icon change. Let's move the
clean up to the set icon instead of waiting for the quit clean up.
TMPDIR is the canonical environment variable in Unix and POSIX that
should be used to specify a temporary directory:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03

Let's use it if is defined to store temporary icon files and default to
'/tmp' if is not defined.
@meskio
Copy link
Contributor Author

meskio commented Oct 15, 2018

I have also added a commit to use TMPDIR env variable if defined to place the temp files there.

@joesis joesis merged commit 99cf6a5 into getlantern:master Oct 17, 2018
leap-code-o-matic pushed a commit to leapcode/bitmask-vpn that referenced this pull request Jan 24, 2019
Stop generating one file in /tmp for each icon change. Let's move the
clean up to the set icon instead of waiting for the quit clean up.
Unlink will remove the file from /tmp, but app_indicator will hold a
descriptor until it finishes with it.

This is a cherry-pick from a pull-request upstream:
getlantern/systray#63

- Resolves: #60
@getlantern getlantern deleted a comment from joesis Mar 1, 2021
ropog3ovomou pushed a commit to ropog3ovomou/systray that referenced this pull request Jul 13, 2022
linux: delete temp files as soon as they are not needed
kalikaneko pushed a commit to leapcode/riseup-vpn-snap that referenced this pull request Apr 21, 2024
Stop generating one file in /tmp for each icon change. Let's move the
clean up to the set icon instead of waiting for the quit clean up.
Unlink will remove the file from /tmp, but app_indicator will hold a
descriptor until it finishes with it.

This is a cherry-pick from a pull-request upstream:
getlantern/systray#63

- Resolves: #60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants