Commit cfdf99f
authored
Better handle startup failures - do not leave dangling processes (#201)
* Move process killing to a separate method
This allows calling just the killing part of quit in a subsequent
commit. This only moves some code, without changing behaviour.
* Terminate process on startup errors
Before, if a process was successfully started, but there would be a
problem in subsequent setup (in particular the dbus connection could
fail), the process could keep running in the background.
This was particularly problematic when this caused the OMXPlayer
constructor to raise an exception, since then no player instance would
be created so the process pid would be lost.
This commit ensures that whenever the OMXPlayer constructor or load
method throws, no process will be dangling in the background.
This fixes #196
* Add more tests for player.quit
This adds test coverage for two exception handling cases.1 parent b1a11bf commit cfdf99f
2 files changed
+70
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
197 | 202 | | |
198 | 203 | | |
199 | 204 | | |
| |||
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
208 | 221 | | |
209 | 222 | | |
210 | 223 | | |
| |||
234 | 247 | | |
235 | 248 | | |
236 | 249 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
241 | 261 | | |
242 | 262 | | |
243 | 263 | | |
| |||
846 | 866 | | |
847 | 867 | | |
848 | 868 | | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | 869 | | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
858 | 873 | | |
859 | 874 | | |
860 | 875 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
49 | 67 | | |
50 | 68 | | |
51 | 69 | | |
| |||
128 | 146 | | |
129 | 147 | | |
130 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
131 | 170 | | |
132 | 171 | | |
133 | 172 | | |
| |||
0 commit comments