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 ;
22using System . Linq ;
33using Flow . Launcher . Infrastructure ;
4- using System . Threading . Tasks ;
54
65namespace Flow . Launcher . Plugin . ProcessKiller
76{
@@ -89,7 +88,8 @@ private List<Result> CreateResultsFromQuery(Query query)
8988 Action = ( c ) =>
9089 {
9190 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 ) ;
9393 return true ;
9494 }
9595 } ) ;
@@ -114,19 +114,14 @@ private List<Result> CreateResultsFromQuery(Query query)
114114 {
115115 processHelper . TryKill ( p . Process ) ;
116116 }
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 ) ;
118119 return true ;
119120 }
120121 } ) ;
121122 }
122123
123124 return sortedResults ;
124125 }
125-
126- private static async Task DelayAndReQueryAsync ( string query )
127- {
128- await Task . Delay ( 500 ) ;
129- _context . API . ChangeQuery ( query , true ) ;
130- }
131126 }
132127}
Original file line number Diff line number Diff line change 1- using Flow . Launcher . Infrastructure ;
1+ using Flow . Launcher . Infrastructure ;
22using Flow . Launcher . Infrastructure . Logger ;
33using System ;
44using System . Collections . Generic ;
@@ -75,6 +75,7 @@ public void TryKill(Process p)
7575 if ( ! p . HasExited )
7676 {
7777 p . Kill ( ) ;
78+ p . WaitForExit ( 50 ) ;
7879 }
7980 }
8081 catch ( Exception e )
You can’t perform that action at this time.
0 commit comments