aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-01-08 20:09:31 +0100
committerdec05eba <dec05eba@protonmail.com>2024-01-08 20:09:35 +0100
commitb003080265399233aad7de08327e25513ccc9ebc (patch)
tree3ea7e2f9ebd665d953eb23fc74634a9bfbff45ad /src
parent4603af2492b7d11f66f8c03e1b38b1429eaf799e (diff)
Kill children
Diffstat (limited to 'src')
-rw-r--r--src/AsyncImageLoader.cpp2
-rw-r--r--src/Downloader.cpp8
-rw-r--r--src/Program.cpp6
-rw-r--r--src/VideoPlayer.cpp2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/AsyncImageLoader.cpp b/src/AsyncImageLoader.cpp
index 2b454da..1118ee6 100644
--- a/src/AsyncImageLoader.cpp
+++ b/src/AsyncImageLoader.cpp
@@ -398,7 +398,7 @@ namespace QuickMedia {
void AsyncImageLoader::reset_download(Download &download) {
std::lock_guard<std::mutex> lock(download_mutex);
if(download.read_program.pid != -1) {
- kill(download.read_program.pid, SIGTERM);
+ kill(download.read_program.pid, SIGKILL);
int status;
waitpid(download.read_program.pid, &status, 0);
download.read_program.pid = -1;
diff --git a/src/Downloader.cpp b/src/Downloader.cpp
index 2c0d316..14580bb 100644
--- a/src/Downloader.cpp
+++ b/src/Downloader.cpp
@@ -81,7 +81,7 @@ namespace QuickMedia {
if(read_program.read_fd != -1)
close(read_program.read_fd);
if(read_program.pid != -1) {
- kill(read_program.pid, SIGTERM);
+ kill(read_program.pid, SIGKILL);
int status;
waitpid(read_program.pid, &status, 0);
}
@@ -273,7 +273,7 @@ namespace QuickMedia {
if(read_program_file)
fclose(read_program_file);
if(read_program.pid != -1) {
- kill(read_program.pid, SIGTERM);
+ kill(read_program.pid, SIGKILL);
int status;
waitpid(read_program.pid, &status, 0);
}
@@ -326,7 +326,7 @@ namespace QuickMedia {
static int64_t seek_fn(YoutubeReadProgram *program, int64_t offset) {
if(program->read_program.pid != -1) {
- kill(program->read_program.pid, SIGTERM);
+ kill(program->read_program.pid, SIGKILL);
int status;
waitpid(program->read_program.pid, &status, 0);
program->read_program.pid = -1;
@@ -387,7 +387,7 @@ namespace QuickMedia {
static void close_fn(YoutubeReadProgram *program) {
if(program->read_program.pid != -1) {
- kill(program->read_program.pid, SIGTERM);
+ kill(program->read_program.pid, SIGKILL);
int status;
waitpid(program->read_program.pid, &status, 0);
program->read_program.pid = -1;
diff --git a/src/Program.cpp b/src/Program.cpp
index de30e4f..70ac6e0 100644
--- a/src/Program.cpp
+++ b/src/Program.cpp
@@ -96,7 +96,7 @@ public:
it->second.program.write_fd = -1;
}
if(it->second.program.pid != -1) {
- kill(it->second.program.pid, SIGTERM);
+ kill(it->second.program.pid, SIGKILL);
int status;
waitpid(it->second.program.pid, &status, 0);
it->second.program.pid = -1;
@@ -272,7 +272,7 @@ int exec_program_write_stdin(const char **args, const char *str, size_t size, Pr
// TODO: Set program.pid to -1 and with currenthreadprogram mutex. Same in other places
if(result != 0)
- kill(program.pid, SIGTERM);
+ kill(program.pid, SIGKILL);
if(waitpid(program.pid, &status, 0) == -1) {
perror("waitpid failed");
@@ -344,7 +344,7 @@ int exec_program(const char **args, ProgramOutputCallback output_callback, void
}
if(result != 0)
- kill(read_program.pid, SIGTERM);
+ kill(read_program.pid, SIGKILL);
if(waitpid(read_program.pid, &status, 0) == -1) {
perror("waitpid failed");
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 26946fc..4642855 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -116,7 +116,7 @@ namespace QuickMedia {
VideoPlayer::~VideoPlayer() {
if(video_process_id != -1) {
- kill(video_process_id, SIGTERM);
+ kill(video_process_id, SIGKILL);
wait_program(video_process_id);
}