File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
Plugins/Flow.Launcher.Plugin.ProcessKiller Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 1
- using System . Collections . Generic ;
1
+ using System . Collections . Generic ;
2
2
using System . Linq ;
3
3
using Flow . Launcher . Infrastructure ;
4
- using System . Threading . Tasks ;
5
4
6
5
namespace Flow . Launcher . Plugin . ProcessKiller
7
6
{
@@ -89,7 +88,8 @@ private List<Result> CreateResultsFromQuery(Query query)
89
88
Action = ( c ) =>
90
89
{
91
90
processHelper . TryKill ( p ) ;
92
- _ = DelayAndReQueryAsync ( query . RawQuery ) ; // Re-query after killing process to refresh process list
91
+ // Re-query to refresh process list
92
+ _context . API . ChangeQuery ( query . RawQuery , true ) ;
93
93
return true ;
94
94
}
95
95
} ) ;
@@ -114,19 +114,14 @@ private List<Result> CreateResultsFromQuery(Query query)
114
114
{
115
115
processHelper . TryKill ( p . Process ) ;
116
116
}
117
- _ = DelayAndReQueryAsync ( query . RawQuery ) ; // Re-query after killing process to refresh process list
117
+ // Re-query to refresh process list
118
+ _context . API . ChangeQuery ( query . RawQuery , true ) ;
118
119
return true ;
119
120
}
120
121
} ) ;
121
122
}
122
123
123
124
return sortedResults ;
124
125
}
125
-
126
- private static async Task DelayAndReQueryAsync ( string query )
127
- {
128
- await Task . Delay ( 500 ) ;
129
- _context . API . ChangeQuery ( query , true ) ;
130
- }
131
126
}
132
127
}
Original file line number Diff line number Diff line change 1
- using Flow . Launcher . Infrastructure ;
1
+ using Flow . Launcher . Infrastructure ;
2
2
using Flow . Launcher . Infrastructure . Logger ;
3
3
using System ;
4
4
using System . Collections . Generic ;
@@ -75,6 +75,7 @@ public void TryKill(Process p)
75
75
if ( ! p . HasExited )
76
76
{
77
77
p . Kill ( ) ;
78
+ p . WaitForExit ( 50 ) ;
78
79
}
79
80
}
80
81
catch ( Exception e )
You can’t perform that action at this time.
0 commit comments