diff --git a/src/protocols/rdp/client.c b/src/protocols/rdp/client.c index 5dbb6d6d..aed5ea68 100644 --- a/src/protocols/rdp/client.c +++ b/src/protocols/rdp/client.c @@ -199,6 +199,14 @@ int guac_rdp_client_free_handler(guac_client* client) { if (rdp_client->filesystem != NULL) guac_rdp_fs_free(rdp_client->filesystem); + /* End active print job, if any */ + guac_rdp_print_job* job = (guac_rdp_print_job*) rdp_client->active_job; + if (job != NULL) { + guac_rdp_print_job_kill(job); + guac_rdp_print_job_free(job); + rdp_client->active_job = NULL; + } + #ifdef ENABLE_COMMON_SSH /* Free SFTP filesystem, if loaded */ if (rdp_client->sftp_filesystem) diff --git a/src/protocols/rdp/print-job.c b/src/protocols/rdp/print-job.c index 81612efc..7564fc88 100644 --- a/src/protocols/rdp/print-job.c +++ b/src/protocols/rdp/print-job.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -666,6 +667,9 @@ void guac_rdp_print_job_free(guac_rdp_print_job* job) { void guac_rdp_print_job_kill(guac_rdp_print_job* job) { + /* Forcibly kill filter process, if running */ + kill(job->filter_pid, SIGKILL); + /* Stop all handling of I/O */ close(job->input_fd); close(job->output_fd);