Skip to content

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

Merged
joesis merged 2 commits intogetlantern:masterfrom
meskio:unlink_temp_files
Oct 17, 2018
Merged

linux: delete temp files as soon as they are not needed#63
joesis merged 2 commits intogetlantern:masterfrom
meskio:unlink_temp_files

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 force-pushed the unlink_temp_files branch from 50524b2 to fde8676 Compare October 12, 2018 00:09
@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
@meskio meskio force-pushed the unlink_temp_files branch from fde8676 to b7080d7 Compare October 15, 2018 16:37
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.
@meskio meskio force-pushed the unlink_temp_files branch from b7080d7 to d461324 Compare October 15, 2018 17:02
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