Fix cleanup order
The order of cleanup was not the reverse as the initialization order. As a consequence, recorder_destroy() could theoretically be called even if recorder_init() failed.
This commit is contained in:
parent
bcd4090d51
commit
8aeb5c0e3c
1 changed files with 4 additions and 4 deletions
|
@ -291,14 +291,14 @@ finally_stop_decoder:
|
|||
// stop the server before decoder_join() to wake up the decoder
|
||||
server_stop(&server);
|
||||
decoder_join(&decoder);
|
||||
finally_destroy_file_handler:
|
||||
file_handler_stop(&file_handler);
|
||||
file_handler_join(&file_handler);
|
||||
file_handler_destroy(&file_handler);
|
||||
finally_destroy_recorder:
|
||||
if (options->record_filename) {
|
||||
recorder_destroy(&recorder);
|
||||
}
|
||||
finally_destroy_file_handler:
|
||||
file_handler_stop(&file_handler);
|
||||
file_handler_join(&file_handler);
|
||||
file_handler_destroy(&file_handler);
|
||||
finally_destroy_video_buffer:
|
||||
video_buffer_destroy(&video_buffer);
|
||||
finally_destroy_server:
|
||||
|
|
Loading…
Reference in a new issue