diff --git a/src/protocols/rdp/client.c b/src/protocols/rdp/client.c index 203bdb08..2dcb401b 100644 --- a/src/protocols/rdp/client.c +++ b/src/protocols/rdp/client.c @@ -24,7 +24,6 @@ #include "rdp.h" #include "rdp_disp.h" #include "rdp_fs.h" -#include "rdp_print_job.h" #include "user.h" #ifdef ENABLE_COMMON_SSH @@ -107,12 +106,6 @@ int guac_rdp_client_free_handler(guac_client* client) { if (rdp_client->filesystem != NULL) guac_rdp_fs_free(rdp_client->filesystem); - /* Clean up print job, if active */ - if (rdp_client->active_job != NULL) { - guac_rdp_print_job_kill(rdp_client->active_job); - guac_rdp_print_job_free(rdp_client->active_job); - } - #ifdef ENABLE_COMMON_SSH /* Free SFTP filesystem, if loaded */ if (rdp_client->sftp_filesystem) diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c index 389c7049..a48230a0 100644 --- a/src/protocols/rdp/rdp.c +++ b/src/protocols/rdp/rdp.c @@ -31,6 +31,7 @@ #include "rdp_cliprdr.h" #include "rdp_disp.h" #include "rdp_fs.h" +#include "rdp_print_job.h" #include "rdp_gdi.h" #include "rdp_glyph.h" #include "rdp_pointer.h" @@ -853,6 +854,12 @@ static int guac_rdp_handle_connection(guac_client* client) { } + /* Clean up print job, if active */ + if (rdp_client->active_job != NULL) { + guac_rdp_print_job_kill(rdp_client->active_job); + guac_rdp_print_job_free(rdp_client->active_job); + } + pthread_mutex_lock(&(rdp_client->rdp_lock)); /* Disconnect client and channels */