Commit e9f2a82
committed
fix: Properly close
Fixes #34
Cleanly closes `adb` and `rclone` connections when the application
exits, ensuring resources are freed and preventing potential issues.
This addresses a previous oversight where these connections weren't
properly closed, potentially leading to resource leaks and unexpected
behavior.
Even though we free up the adb connection we don't close the server
because other programs may be using the connection.
The changes introduce a `destroy()` function in `tools.js` that handles
the cleanup. This function is called when the application receives the
"will-quit" event, ensuring that resources are freed before the
application terminates.
This change enhances the application's reliability and stability by
preventing resource leaks and ensuring a clean exit.adb and rclone on exit1 parent aa85722 commit e9f2a82
2 files changed
Lines changed: 37 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
541 | 546 | | |
542 | 547 | | |
543 | 548 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
908 | 909 | | |
909 | 910 | | |
910 | 911 | | |
911 | | - | |
| 912 | + | |
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
| |||
926 | 927 | | |
927 | 928 | | |
928 | 929 | | |
929 | | - | |
930 | | - | |
| 930 | + | |
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
938 | 949 | | |
939 | 950 | | |
940 | 951 | | |
| |||
1495 | 1506 | | |
1496 | 1507 | | |
1497 | 1508 | | |
1498 | | - | |
| 1509 | + | |
1499 | 1510 | | |
1500 | 1511 | | |
1501 | 1512 | | |
| |||
1624 | 1635 | | |
1625 | 1636 | | |
1626 | 1637 | | |
1627 | | - | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
1636 | 1650 | | |
1637 | | - | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
1638 | 1655 | | |
1639 | 1656 | | |
1640 | 1657 | | |
| |||
0 commit comments